13

I am deploying a Ruby on Rails application and part of the startup script that I have when provisioning a new box is gem update --system.

This happened to upgrade Rubygems to version 2.0. however, it looks like bundler is not compatible with this newer version of Rubygems.

Bundler is not compatible with Rubygems 2.0.
Please upgrade to Bundler 1.3 or higher.

Has anyone seen this or found a workaround?

kobaltz
  • 6,980
  • 1
  • 35
  • 52

3 Answers3

18

Updating to the prerelease of bundler fixed it.

gem install bundler --pre
kobaltz
  • 6,980
  • 1
  • 35
  • 52
  • That isn't working for me, installing "bundler --pre" hasn't solved the problem in my case. The app is using Rails 3.2.12 and Ruby 2.0.0p0. – Adrien Lamothe Feb 25 '13 at 20:37
  • What version of Bundler are you using? What version of gem? – kobaltz Feb 25 '13 at 20:45
  • gem version 2.0.0 and bundler version 1.3.0 – Adrien Lamothe Feb 26 '13 at 00:22
  • Took this as an opportunity to install Rails 4 with Ruby 2.0.0 and no go, getting the error: $gem install rails --pre ERROR: While executing gem ... (Gem::DependencyError) Unable to resolve dependencies: rails requires activesupport (= 4.0.0.beta1), actionpack (= 4.0.0.beta1), activerecord (= 4.0.0.beta1), actionmailer (= 4.0.0.beta1), railties (= 4.0.0.beta1), sprockets-rails (~> 2.0.0.rc3) – Adrien Lamothe Feb 26 '13 at 01:00
  • 1
    Wow, I'm sure glad I have my Ruby 1.9.3p374 install to fall back on. A word of warning to all: DO NOT DO A "gem update --system", else you risk totally messing up your Ruby installation with no chance of recovery until this issue is solved. Wish I had the time to dig into it. – Adrien Lamothe Feb 26 '13 at 01:05
4

I had the same problem and, since I was using RVM, I fixed it with the following command:

rvm rubygems 1.8.25

If you are not using RVM, you could just try the following:

rubygems 1.8.25

This should remove your Rubygems 2.0 and allow Bundler to work again.

apaderno
  • 28,547
  • 16
  • 75
  • 90
0

As it is written here, in order to install prereleases using RubyGems 2.0 you must specify the version and disable ri and rdoc:

gem install rails --version=4.0.0.beta1 --no-ri --no-rdoc

This works with bundler 1.3.0 too.

mdesantis
  • 8,257
  • 4
  • 31
  • 63