Skip to content

Attempting to install on fresh Rails 5.1 app fails #91

Closed

Description

@patcoll

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?

Activity

  1. self-assigned this
    on Nov 14, 2017
  2. ashanbrown commented on Nov 14, 2017

    @ashanbrown
    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'
    
  3. patcoll commented on Nov 15, 2017

    @patcoll
    Author

    @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

  4. ashanbrown commented on Nov 16, 2017

    @ashanbrown
    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.

  5. added a commit that references this issue on Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions