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

Sinatra Gem Conflict #1117

Closed
kylestengline opened this Issue May 19, 2016 · 12 comments

Comments

Projects
None yet
8 participants
@kylestengline

kylestengline commented May 19, 2016

I have a sinatra app with this in the gemfile
gem "rake"
gem "pg"
gem "sinatra" tried this uncommented then bundled //, :github => 'sinatra/sinatra', :branch => "master"
//gem "rack", "~> 1.5" commented this out then bundled, uncommented, then bundled again.
gem "sinatra-contrib"
gem "pry"
gem "rspec"
gem “capybara”

I’m getting this error
Unable to activate sinatra-1.4.7, because rack-2.0.0.rc1 conflicts with rack (~> 1.5) (Gem::ConflictError)
when I try to
rackup -p 3000 or rackup
I tried bundle update rack and bundle update tried to use the master branch in my gemfile for sinatra, but still getting this error.
For some reason bundle exec rackup is the only way to load the server now.
Anyone have any ideas or get this error before?

@zzak

This comment has been minimized.

Show comment
Hide comment
@zzak

zzak May 20, 2016

Member

Sinatra release 1.4.7 gem is not compatible with current master branch on github, this is because they target 2 different major versions of Rack.

So if you already installed Sinatra 1.4.7 (which depends on Rack ~> 1.5) in your Gemfile.lock, then trying to install master will fail.

You need to either remove the rack constraint, or change it, in order to use sinatra from master; and then update your Gemfile.lock.

Does that make sense?

Member

zzak commented May 20, 2016

Sinatra release 1.4.7 gem is not compatible with current master branch on github, this is because they target 2 different major versions of Rack.

So if you already installed Sinatra 1.4.7 (which depends on Rack ~> 1.5) in your Gemfile.lock, then trying to install master will fail.

You need to either remove the rack constraint, or change it, in order to use sinatra from master; and then update your Gemfile.lock.

Does that make sense?

@dreamingblackcat

This comment has been minimized.

Show comment
Hide comment
@dreamingblackcat

dreamingblackcat May 20, 2016

I encountered the same error too. Here is my Gemfile

source "https://rubygems.org"

gem 'bson_ext'
gem 'grape'
gem 'grape-entity'
gem 'mongo'
gem 'rake'
gem 'sinatra'

group :development do
  gem 'shotgun'
end

group :test do
  gem 'rack-test'
  gem 'rspec'
end

I tried downgrading sinatra gem to '1.4.6' in the Gemfile but strangely I got
Gem::ConflictError: Unable to activate sinatra-1.4.7, because rack-2.0.0.rc1 conflicts with rack (~> 1.5) again.

Here is my Gemfile.lock after downgrading to sinatra 1.4.6

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (4.2.6)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    axiom-types (0.1.1)
      descendants_tracker (~> 0.0.4)
      ice_nine (~> 0.11.0)
      thread_safe (~> 0.3, >= 0.3.1)
    bson (1.12.5)
    bson_ext (1.12.5)
      bson (~> 1.12.5)
    builder (3.2.2)
    coercible (1.0.0)
      descendants_tracker (~> 0.0.1)
    descendants_tracker (0.0.4)
      thread_safe (~> 0.3, >= 0.3.1)
    diff-lcs (1.2.5)
    enumerable-lazy (0.0.1)
    equalizer (0.0.11)
    grape (0.16.2)
      activesupport
      builder
      hashie (>= 2.1.0)
      multi_json (>= 1.3.2)
      multi_xml (>= 0.5.2)
      mustermann19 (~> 0.4.3)
      rack (>= 1.3.0)
      rack-accept
      virtus (>= 1.0.0)
    grape-entity (0.5.1)
      activesupport
      multi_json (>= 1.3.2)
    hashie (3.4.4)
    i18n (0.7.0)
    ice_nine (0.11.2)
    json (1.8.3)
    minitest (5.9.0)
    mongo (1.12.5)
      bson (= 1.12.5)
    multi_json (1.12.1)
    multi_xml (0.5.5)
    mustermann19 (0.4.3)
      enumerable-lazy
    rack (1.6.4)
    rack-accept (0.4.5)
      rack (>= 0.4)
    rack-protection (1.5.3)
      rack
    rack-test (0.6.3)
      rack (>= 1.0)
    rake (11.1.2)
    rspec (3.4.0)
      rspec-core (~> 3.4.0)
      rspec-expectations (~> 3.4.0)
      rspec-mocks (~> 3.4.0)
    rspec-core (3.4.4)
      rspec-support (~> 3.4.0)
    rspec-expectations (3.4.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.4.0)
    rspec-mocks (3.4.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.4.0)
    rspec-support (3.4.1)
    shotgun (0.9.1)
      rack (>= 1.0)
    sinatra (1.4.6)
      rack (~> 1.4)
      rack-protection (~> 1.4)
      tilt (>= 1.3, < 3)
    thread_safe (0.3.5)
    tilt (2.0.4)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    virtus (1.0.5)
      axiom-types (~> 0.1)
      coercible (~> 1.0)
      descendants_tracker (~> 0.0, >= 0.0.3)
      equalizer (~> 0.0, >= 0.0.9)

PLATFORMS
  ruby

DEPENDENCIES
  bson_ext
  grape
  grape-entity
  mongo
  rack-test
  rake
  rspec
  shotgun
  sinatra (= 1.4.6)

BUNDLED WITH
   1.12.3

dreamingblackcat commented May 20, 2016

I encountered the same error too. Here is my Gemfile

source "https://rubygems.org"

gem 'bson_ext'
gem 'grape'
gem 'grape-entity'
gem 'mongo'
gem 'rake'
gem 'sinatra'

group :development do
  gem 'shotgun'
end

group :test do
  gem 'rack-test'
  gem 'rspec'
end

I tried downgrading sinatra gem to '1.4.6' in the Gemfile but strangely I got
Gem::ConflictError: Unable to activate sinatra-1.4.7, because rack-2.0.0.rc1 conflicts with rack (~> 1.5) again.

Here is my Gemfile.lock after downgrading to sinatra 1.4.6

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (4.2.6)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    axiom-types (0.1.1)
      descendants_tracker (~> 0.0.4)
      ice_nine (~> 0.11.0)
      thread_safe (~> 0.3, >= 0.3.1)
    bson (1.12.5)
    bson_ext (1.12.5)
      bson (~> 1.12.5)
    builder (3.2.2)
    coercible (1.0.0)
      descendants_tracker (~> 0.0.1)
    descendants_tracker (0.0.4)
      thread_safe (~> 0.3, >= 0.3.1)
    diff-lcs (1.2.5)
    enumerable-lazy (0.0.1)
    equalizer (0.0.11)
    grape (0.16.2)
      activesupport
      builder
      hashie (>= 2.1.0)
      multi_json (>= 1.3.2)
      multi_xml (>= 0.5.2)
      mustermann19 (~> 0.4.3)
      rack (>= 1.3.0)
      rack-accept
      virtus (>= 1.0.0)
    grape-entity (0.5.1)
      activesupport
      multi_json (>= 1.3.2)
    hashie (3.4.4)
    i18n (0.7.0)
    ice_nine (0.11.2)
    json (1.8.3)
    minitest (5.9.0)
    mongo (1.12.5)
      bson (= 1.12.5)
    multi_json (1.12.1)
    multi_xml (0.5.5)
    mustermann19 (0.4.3)
      enumerable-lazy
    rack (1.6.4)
    rack-accept (0.4.5)
      rack (>= 0.4)
    rack-protection (1.5.3)
      rack
    rack-test (0.6.3)
      rack (>= 1.0)
    rake (11.1.2)
    rspec (3.4.0)
      rspec-core (~> 3.4.0)
      rspec-expectations (~> 3.4.0)
      rspec-mocks (~> 3.4.0)
    rspec-core (3.4.4)
      rspec-support (~> 3.4.0)
    rspec-expectations (3.4.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.4.0)
    rspec-mocks (3.4.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.4.0)
    rspec-support (3.4.1)
    shotgun (0.9.1)
      rack (>= 1.0)
    sinatra (1.4.6)
      rack (~> 1.4)
      rack-protection (~> 1.4)
      tilt (>= 1.3, < 3)
    thread_safe (0.3.5)
    tilt (2.0.4)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    virtus (1.0.5)
      axiom-types (~> 0.1)
      coercible (~> 1.0)
      descendants_tracker (~> 0.0, >= 0.0.3)
      equalizer (~> 0.0, >= 0.0.9)

PLATFORMS
  ruby

DEPENDENCIES
  bson_ext
  grape
  grape-entity
  mongo
  rack-test
  rake
  rspec
  shotgun
  sinatra (= 1.4.6)

BUNDLED WITH
   1.12.3
@kylestengline

This comment has been minimized.

Show comment
Hide comment
@kylestengline

kylestengline May 20, 2016

Hi zzak,

Thank you so much for getting back to me.
That makes sense. However, how do I remove that constraint or change it?
I tried to bundle update rack as well as setting the rack version in my gemfile, but when I run bundle I get this error...

You have requested:
rack ~> 2.0.0

The bundle currently has rack locked at 1.6.4.
Try running bundle update rack

If you are updating multiple gems in your Gemfile at once,
try passing them all to bundle update

I tried searching around, but can't find a way to remove the constraint or change it. Would you have any suggestions?

kylestengline commented May 20, 2016

Hi zzak,

Thank you so much for getting back to me.
That makes sense. However, how do I remove that constraint or change it?
I tried to bundle update rack as well as setting the rack version in my gemfile, but when I run bundle I get this error...

You have requested:
rack ~> 2.0.0

The bundle currently has rack locked at 1.6.4.
Try running bundle update rack

If you are updating multiple gems in your Gemfile at once,
try passing them all to bundle update

I tried searching around, but can't find a way to remove the constraint or change it. Would you have any suggestions?

@zzak

This comment has been minimized.

Show comment
Hide comment
@zzak

zzak May 21, 2016

Member
Member

zzak commented May 21, 2016

@b264 b264 referenced this issue Jun 24, 2016

Closed

New Release #1123

@zzak

This comment has been minimized.

Show comment
Hide comment
@zzak

zzak Jun 27, 2016

Member

Please try bundle update after changing your Gemfile to use master:

gem 'sinatra', github: 'sinatra/sinatra'

Thanks!

Member

zzak commented Jun 27, 2016

Please try bundle update after changing your Gemfile to use master:

gem 'sinatra', github: 'sinatra/sinatra'

Thanks!

@zzak zzak closed this Jun 27, 2016

@mfrederickson

This comment has been minimized.

Show comment
Hide comment
@mfrederickson

mfrederickson Jul 22, 2016

Just in case anyone had a conflict like I did.... I was running capybara from within my sinatra application for checking the health of another web application and was getting argument problems and something about rack versions. Once I removed the include Capybara::DSL from my class, everything worked fine (I wasn't using the shortcuts that provided).

App 25961 stderr: 2016-07-21 21:55:29 - ArgumentError - wrong number of arguments (given 1, expected 0):
App 25961 stderr:   /usr/local/rvm/gems/ruby-2.3.0/gems/capybara-2.7.1/lib/capybara/session.rb:152:in `html'
App 25961 stderr:   /usr/local/rvm/gems/ruby-2.3.0/gems/capybara-2.7.1/lib/capybara/dsl.rb:52:in `block (2 levels) in <module:DSL>'
App 25961 stderr:   /usr/local/rvm/gems/ruby-2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1072:in `invoke'
App 25961 stderr:   /usr/local/rvm/gems/ruby-2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1082:in `dispatch!'
App 25961 stderr:   /usr/local/rvm/gems/ruby-2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in `block in call!'

mfrederickson commented Jul 22, 2016

Just in case anyone had a conflict like I did.... I was running capybara from within my sinatra application for checking the health of another web application and was getting argument problems and something about rack versions. Once I removed the include Capybara::DSL from my class, everything worked fine (I wasn't using the shortcuts that provided).

App 25961 stderr: 2016-07-21 21:55:29 - ArgumentError - wrong number of arguments (given 1, expected 0):
App 25961 stderr:   /usr/local/rvm/gems/ruby-2.3.0/gems/capybara-2.7.1/lib/capybara/session.rb:152:in `html'
App 25961 stderr:   /usr/local/rvm/gems/ruby-2.3.0/gems/capybara-2.7.1/lib/capybara/dsl.rb:52:in `block (2 levels) in <module:DSL>'
App 25961 stderr:   /usr/local/rvm/gems/ruby-2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1072:in `invoke'
App 25961 stderr:   /usr/local/rvm/gems/ruby-2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1082:in `dispatch!'
App 25961 stderr:   /usr/local/rvm/gems/ruby-2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in `block in call!'
@fwolfst

This comment has been minimized.

Show comment
Hide comment
@fwolfst

fwolfst Aug 7, 2016

I have a similar problem with a gem depending on active_records_migrations, for which I'd like to use the 5.x line.

When will a sinatra-version with rack 2.0 support be released (roughly)?

fwolfst commented Aug 7, 2016

I have a similar problem with a gem depending on active_records_migrations, for which I'd like to use the 5.x line.

When will a sinatra-version with rack 2.0 support be released (roughly)?

fwolfst added a commit to rawliving-germany/rawgento_models that referenced this issue Aug 9, 2016

@Jorybraun

This comment has been minimized.

Show comment
Hide comment
@Jorybraun

Jorybraun Aug 13, 2016

Also having this conflict

Jorybraun commented Aug 13, 2016

Also having this conflict

@Topher33

This comment has been minimized.

Show comment
Hide comment
@Topher33

Topher33 Oct 11, 2016

@zzak seem like you are aware of the same conflict, but if you want to use sinatra master because of rails 5 conflict... seems like there is no way right now to use sinatra-contrib because of its dependancy on sinatra ~>1.4.7....

Anyone else have this issue, or solve?

Topher33 commented Oct 11, 2016

@zzak seem like you are aware of the same conflict, but if you want to use sinatra master because of rails 5 conflict... seems like there is no way right now to use sinatra-contrib because of its dependancy on sinatra ~>1.4.7....

Anyone else have this issue, or solve?

@carltonsmith

This comment has been minimized.

Show comment
Hide comment
@carltonsmith

carltonsmith Mar 20, 2017

same problem here

carltonsmith commented Mar 20, 2017

same problem here

@zzak

This comment has been minimized.

Show comment
Hide comment
@zzak

zzak Mar 20, 2017

Member

@cls3 Can you try using gem 'sinatra', '2.0.0.rc2'?

Member

zzak commented Mar 20, 2017

@cls3 Can you try using gem 'sinatra', '2.0.0.rc2'?

@carltonsmith

This comment has been minimized.

Show comment
Hide comment
@carltonsmith

carltonsmith Mar 20, 2017

That did the trick!

carltonsmith commented Mar 20, 2017

That did the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment