Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
664 views
in Technique[技术] by (71.8m points)

ruby on rails - Bundler could not find compatible versions for gem "bundler":

Complete new person to Ruby and Rails here... Have tried some tutorials in the past, but that's about it. I'm trying to follow 'Ruby on Rails 3 Tutorial' book and have hit a roadblock that I haven't been able to find any help for after searching on here and the Google..

I haven't actually done anything yet; only:

rails new first_app

then changed the Gemfile sqlite3 to

gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

When I run 'bundle install' I get the following:

Fetching gem metadata from http://rubygems.org/.........
Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (= 3.0.1) ruby depends on
      bundler (~> 1.0.0) ruby

  Current Bundler version:
    bundler (1.1.3)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

I've tried uninstalling the bundler via

gem uninstall bundler -v 1.1.3

and then installing bundler v1.0.0 via

gem install bundler -v 1.0.0

but it seems to get me bundler 1.1.2..

I just feel like I've hit a dead end and can't find any more information on how to solve this issue.

Any help would be greatly appreciated and rewarded with copious amounts of bacon...

UPDATE UPDATE UPDATE

I couldn't get bundler v 1.1.2 to uninstall. I finally was able to uninstall all of the gems by doing:

sudo gem list | cut -d" " -f1 > gem_list.txt  
cat gem_list.txt | xargs sudo gem uninstall -aIx  
cat gem_list.txt | xargs sudo gem install

And then reinstalling... This allowed me to then do the 'bundle install' and get on track.. Thank you all for your help!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

it is because gems are also installed in global gemset, and you can uninstall it using:

rvm @global do gem uninstall bundler

but you can also use the other version of bundler using:

gem install bundler -v '~>1.0.0'
bundle _1.0.0_ install

replace 1.0.0 with the version that got installed (if other)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...