背景细节:我在Ubuntu12.04中运行Ruby2.2.0和Rails 4.1.0。
当我输入rails -v时,我会得到错误消息:
Could not find gem 'sqlite3-ruby (= 1.3.1) ruby' in the gems available on this machine.
Try running `bundle install`.当我输入bundle install时:
我得到:
Fetching gem metadata from http://rubygems.org/...........
Fetching version metadata from http://rubygems.org/..
Resolving dependencies...
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.8.4)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?最糟糕的是,它仍然显示Rails (3.0.1),这不是我的计算机上rails的当前版本。
我试图通过键入以下命令安装sqllite3-ruby:
sudo apt-get install libsqlite3-dev但我明白:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libsqlite3-dev is already the newest version.
The following packages were automatically installed and are no longer required:
ruby-builder ruby-blankslate ruby-text-format ruby-activesupport-2.3 rubygems ruby-i18n rake libjs-prototype libmemcache-client-ruby1.8
ruby-actionmailer-2.3 libmemcache-client-ruby ruby-activerecord-2.3 ruby-rchardet ruby-rack ruby-tmail libjs-scriptaculous libtzinfo-ruby1.8
ruby-rails-2.3 ruby-activeresource-2.3 libtzinfo-ruby ruby-actionpack-2.3
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 455 not upgraded.更新:

发布于 2015-03-07 15:27:40
检查Gemfile中的rails版本。您的应用程序似乎是用rails 3.0.1构建的。因此,bundle install希望安装Gemfile中所要求的所有gem版本。正如您的终端中的消息所述,rails 3.0.1依赖于bundler 1.0.0,但您目前已安装了bundler 1.8.4。
Yo有两种可能性:要么将你现有的应用升级到完整的rails版本(4.2.0),要么将所有安装的依赖于rails的gems降级为rails 3.0.1。
https://stackoverflow.com/questions/28916248
复制相似问题