【问题标题】:Sqlite3-ruby Missing. But not reallySqlite3-ruby 缺失。但不是真的
【发布时间】:2015-03-07 15:05:47
【问题描述】:

所以背景细节:我在 Ubuntu 12.04 中运行 Ruby 2.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.

更新:

【问题讨论】:

  • 再次:检查您的 Gemfile。您的应用正在寻找 sqlite3-ruby 版本 1.3.1,但您安装了版本 1.3.3。您的 Gemfile 中的 gem 版本与实际安装的 gem 版本不一致。

标签: ruby-on-rails ruby ruby-on-rails-3 ruby-on-rails-4 sqlite


【解决方案1】:

检查 Gemfile 中的 rails 版本。看来您的应用程序是使用 rails 3.0.1 构建的。所以bundle install 想要安装 Gemfile 中请求的所有 gem 版本。正如您终端中的消息所说,rails 3.0.1 依赖于 bundler 1.0.0,但您当前安装了 bundler 1.8.4。

您有两种可能性:将现有应用程序升级到安装的 rails 版本 (4.2.0) 或将所有已安装的依赖于 rails 的 gem 降级到 rails 3.0.1。

【讨论】:

    猜你喜欢
    • 2013-05-06
    • 2016-12-28
    • 2016-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-17
    相关资源
    最近更新 更多