Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to activate rails 3.0.1 because of bundler version conflict

so I run:

$ gem install rails --version 3.0.1

Successfully installed rails-3.0.1
1 gem installed
Installing ri documentation for rails-3.0.1...
Installing RDoc documentation for rails-3.0.1...

then I get the error:

$ rails -v
/usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1637:in `raise_if_conflicts': Unable to activate rails-3.0.1, because bundler-1.1.4 conflicts with bundler (~> 1.0.0) (Gem::LoadError)
from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:746:in `activate'
from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems.rb:1232:in `gem'
from /usr/local/rvm/gems/ruby-1.9.3-p125@rails3tutorial/bin/rails:18:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p125@rails3tutorial/bin/ruby_noexec_wrapper:14:in `eval'
from /usr/local/rvm/gems/ruby-1.9.3-p125@rails3tutorial/bin/ruby_noexec_wrapper:14:in `<main>'
like image 344
user722583 Avatar asked Jun 12 '12 19:06

user722583


3 Answers

So Rails 3.0.1 requires Bundler v1.0.0 - v1.0.22 (actually any 1.0.x version up to, but not including, 1.1.0), but you have a newer version of Bundler that's being loaded when Rails is started. You could uninstall the newer version(s) of Bundler (though this is a crappy way to deal with the issue) or since you're using RVM, just create a gemset for Rails 3.0.1.

$ rvm gemset create rails_3.0.1
$ rvm gemset use rails_3.0.1
$ gem install rails -v 3.0.1
$ rails -v
3.0.1

Note: this requires that Bundler not be in your global gemset for the Ruby version you're trying to use. If the global gemset contains a Bundler version equal to or higher than 1.1.0 then you'll get the same error as before.

Update: A little explanation about ~> and RubyGems versioning might be handy. The section on pessimistic version constraint in the RubyGems docs does a fantastic job of covering everything.

like image 62
Colin R Avatar answered Nov 15 '22 16:11

Colin R


You may need to update to bundler 1.1.4.

gem update bundler

should do the trick.

like image 3
ipd Avatar answered Nov 15 '22 16:11

ipd


This is possibly due to Ruby v1.9.2/3 uses bundler v1.1.4 while Rails v3.0.1 requires bundler v~1.0.0. Hence, by simply updating the Rails version to v3.2.6, the conflict is solved. This conflict can be easily solved by matching the Ruby and Rails version.

like image 2
Sann C. Avatar answered Nov 15 '22 15:11

Sann C.