【问题标题】:I cannot install the SQLite3 Gem in my bundle for rails (I can install it as a gem, but not in my gemfile)?我无法在我的 Rails 包中安装 SQLite3 Gem(我可以将其安装为 gem,但不能安装在我的 gemfile 中)?
【发布时间】:2013-12-12 04:07:06
【问题描述】:

我在尝试让 SQLite gem 在我的 Rails 项目中工作时遇到了很多麻烦。

经过大量查找,我找到了一个教程来帮助解决我的问题,至少,我认为它可以解决我的问题。它让我实际安装了 gem,这对我帮助不大。当我把它放在我的 gemfile 中时,bundle install 会做以下三件事之一:

  1. 它完全忽略了宝石。
  2. 在构建 gem 原生扩展时遇到错误。
  3. 我忘了提其他事情,因为有时会发生一些随机事件。

欢迎任何帮助。

我的 Gemfile 和 Gemfile.lock:http://pastebin.com/h9g4S7YM(也显示如下):

宝石文件:

source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.1'

group :development, :test do
  gem 'sqlite3', "1.3.7"
  gem 'rspec-rails', '2.13.1'
end

group :test do
  gem 'selenium-webdriver', '2.35.1'
  gem 'capybara', '2.1.0'
end

gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end

group :production do
  gem 'pg', '0.15.1'
  gem 'rails_12factor', '0.0.2'
end

Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.0.1)
      actionpack (= 4.0.1)
      mail (~> 2.5.4)
    actionpack (4.0.1)
      activesupport (= 4.0.1)
      builder (~> 3.1.0)
      erubis (~> 2.7.0)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    activemodel (4.0.1)
      activesupport (= 4.0.1)
      builder (~> 3.1.0)
    activerecord (4.0.1)
      activemodel (= 4.0.1)
      activerecord-deprecated_finders (~> 1.0.2)
      activesupport (= 4.0.1)
      arel (~> 4.0.0)
    activerecord-deprecated_finders (1.0.3)
    activesupport (4.0.1)
      i18n (~> 0.6, >= 0.6.4)
      minitest (~> 4.2)
      multi_json (~> 1.3)
      thread_safe (~> 0.1)
      tzinfo (~> 0.3.37)
    arel (4.0.1)
    atomic (1.1.14)
    builder (3.1.4)
    capybara (2.1.0)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      xpath (~> 2.0)
    childprocess (0.3.9)
      ffi (~> 1.0, >= 1.0.11)
    coffee-rails (4.0.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.6.3)
    diff-lcs (1.2.5)
    erubis (2.7.0)
    execjs (2.0.2)
    ffi (1.9.3-x86-mingw32)
    hike (1.2.3)
    i18n (0.6.5)
    jbuilder (1.0.2)
      activesupport (>= 3.0.0)
    jquery-rails (3.0.4)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.8.1)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.25.1)
    mini_portile (0.5.2)
    minitest (4.7.5)
    multi_json (1.8.2)
    nokogiri (1.6.0-x86-mingw32)
      mini_portile (~> 0.5.0)
    pg (0.15.1-x86-mingw32)
    polyglot (0.3.3)
    rack (1.5.2)
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (4.0.1)
      actionmailer (= 4.0.1)
      actionpack (= 4.0.1)
      activerecord (= 4.0.1)
      activesupport (= 4.0.1)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.0.1)
      sprockets-rails (~> 2.0.0)
    rails_12factor (0.0.2)
      rails_serve_static_assets
      rails_stdout_logging
    rails_serve_static_assets (0.0.1)
    rails_stdout_logging (0.0.3)
    railties (4.0.1)
      actionpack (= 4.0.1)
      activesupport (= 4.0.1)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (10.1.0)
    rdoc (3.12.2)
      json (~> 1.4)
    rspec-core (2.13.1)
    rspec-expectations (2.13.0)
      diff-lcs (>= 1.1.3, < 2.0)
    rspec-mocks (2.13.1)
    rspec-rails (2.13.1)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 2.13.0)
      rspec-expectations (~> 2.13.0)
      rspec-mocks (~> 2.13.0)
    rubyzip (0.9.9)
    sass (3.2.12)
    sass-rails (4.0.1)
      railties (>= 4.0.0, < 5.0)
      sass (>= 3.1.10)
      sprockets-rails (~> 2.0.0)
    sdoc (0.3.20)
      json (>= 1.1.3)
      rdoc (~> 3.10)
    selenium-webdriver (2.35.1)
      childprocess (>= 0.2.5)
      multi_json (~> 1.0)
      rubyzip (< 1.0.0)
      websocket (~> 1.0.4)
    sprockets (2.10.1)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sprockets-rails (2.0.1)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (~> 2.8)
    sqlite3 (1.3.7-x86-mingw32)
    thor (0.18.1)
    thread_safe (0.1.3)
      atomic
    tilt (1.4.1)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    turbolinks (1.1.1)
      coffee-rails
    tzinfo (0.3.38)
    uglifier (2.1.1)
      execjs (>= 0.3.0)
      multi_json (~> 1.0, >= 1.0.2)
    websocket (1.0.7)
    xpath (2.0.0)
      nokogiri (~> 1.3)

PLATFORMS
  x86-mingw32

DEPENDENCIES
  capybara (= 2.1.0)
  coffee-rails (= 4.0.1)
  jbuilder (= 1.0.2)
  jquery-rails (= 3.0.4)
  pg (= 0.15.1)
  rails (= 4.0.1)
  rails_12factor (= 0.0.2)
  rspec-rails (= 2.13.1)
  sass-rails (= 4.0.1)
  sdoc (= 0.3.20)
  selenium-webdriver (= 2.35.1)
  sqlite3 (= 1.3.7)
  turbolinks (= 1.1.1)
  uglifier (= 2.1.1)

捆绑安装后(通常)发生的情况的屏幕截图,以及实际错误是什么:http://imgur.com/G7tFl4W(如下所示)

【问题讨论】:

  • 在你的windows系统上你到底运行什么代码?
  • 你在运行 bundle install 后是否重启了服务器?
  • 是的,我重新启动了,我有 Windows 7(Ruby 2.0.0,Rails 4.0.0)

标签: ruby-on-rails ruby sqlite bundler sqlite3-ruby


【解决方案1】:

您运行的是 64 位版本的 Windows 吗? Bundler 最新发布的版本还不支持这个平台,但是下一个版本会支持。尝试升级到最新的 Bundler 预发布版本:

gem install --pre bundler

然后再次运行bundle install

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-11
    • 2011-06-30
    • 2013-01-19
    • 1970-01-01
    • 2011-06-28
    • 2016-03-13
    • 2010-09-30
    • 2018-12-12
    相关资源
    最近更新 更多