Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to install on fresh Rails 5.1 app fails #91

Closed
patcoll opened this issue Nov 14, 2017 · 3 comments
Closed

Attempting to install on fresh Rails 5.1 app fails #91

patcoll opened this issue Nov 14, 2017 · 3 comments
Assignees

Comments

@patcoll
Copy link

patcoll commented Nov 14, 2017

Steps to reproduce:

  1. Use Ruby 2.4.1
  2. Use Rails 5.1.4
  3. rails new testapp
  4. Add gem to Gemfile
    • These both give the same results:
      • gem 'ldclient-rb', '~> 2.2.7'
      • gem 'ldclient-rb', github: 'launchdarkly/ruby-client', ref: 'fbccbb1'
  5. bundle

Expected behavior is that the gem would install cleanly. Instead, I get:

Bundler could not find compatible versions for gem "nio4r":
  In snapshot (Gemfile.lock):
    nio4r (= 2.1.0)

  In Gemfile:
    rails (~> 5.1.4) was resolved to 5.1.4, which depends on
      actioncable (= 5.1.4) was resolved to 5.1.4, which depends on
        nio4r (~> 2.0)

    ldclient-rb was resolved to 2.2.7, which depends on
      ld-celluloid-eventsource (~> 0.10.0) was resolved to 0.10.0, which depends on
        nio4r (~> 1.1)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

It looks like the nio4r version conflicts with that of ActionCable, a new feature/dependency of Rails 5.1.

I'm not sure what the upgrade path from nio4r 1.x to 2.x is. I looked at the docs and it was not obvious at all. Could someone shed any light on that?

@ashanbrown ashanbrown self-assigned this Nov 14, 2017
@ashanbrown
Copy link
Contributor

Hi @patcoll, thanks for your report. I think it's likely that we just have an over-restrictive version specification for our ld-celluloid-eventsource gem. I've created a branch of ld-celluloid-eventsource at https://github.com/launchdarkly/celluloid-eventsource/tree/update-nio4r-dependency that allows for major version upgrades of nio4r. Please let us know if this works for you. I was able to get it to bundle although I don't know how it behaves at runtime. You can use it by adding the following to your Gemfile:

gem 'ld-celluloid-eventsource', github: 'launchdarkly/celluloid-eventsource', branch: 'update-nio4r-dependency'

@patcoll
Copy link
Author

patcoll commented Nov 15, 2017

@ashanbrown That bundles for me just fine.

However, I'm gleefully unaware of the differences in API between nio4r versions 1 and 2. I've never used the gem before. From some snooping in the gemspec, it appears there are Ruby version concerns around the major version change? I'm not sure.

I forked the ldclient-rb repo, updated the dependency, and all tests pass locally for me with Ruby 2.4.1 on macOS 10.12.6.

See this PR: #92

@ashanbrown
Copy link
Contributor

Release https://github.com/launchdarkly/ruby-client/releases/tag/2.3.1 should bundle with Rails 5.1. Please do let us know if there are any other issues with Rails 4.1. Closing for now.

eli-darkly added a commit that referenced this issue Jan 5, 2019
make some dependencies less strict and remove some unused ones
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants