我有一个使用 Ruby 1.9.2 的 Rails 3.0.0 项目。现在我尝试在具有当前 rvm 的新计算机上运行它,它会说:
$ rails s
/Users/michael/.rvm/gems/ruby-1.9.2-p318@global/gems/bundler-1.1.3/lib/bundler/resolver.rb:129:in `block in resolve': Bundler could not find compatible versions for gem "bundler": (Bundler::VersionConflict)
In Gemfile:
rails (= 3.0.0) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.1.3)
但我已经用过
gem install rails -v 3.0.0
gem install bundler -v 1.0.0
gem install bundler -v 1.0.2
所以当我gem list
,我会看到
bundler (1.1.3, 1.0.22, 1.0.0)
rails (3.0.0)
那么为什么它仍然在抱怨 Rails 3.0.0 需要 bundler 1.0.0 而它不存在呢?如何让项目再次运行?
更新:我的 Gemfile 主要是评论,除了:
source 'http://rubygems.org'
gem 'rails', '3.0.0'
gem 'sqlite3-ruby', :require => 'sqlite3'
更新 2:如果我运行bundle check
:
$ bundle check
Your Gemfile's dependencies could not be satisfied
Install missing gems with `bundle install`
$ bundle install
Fetching gem metadata from http://rubygems.org/.........
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.0) 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`?