sqlite - Heroku 正在尝试安装 sqlite3 gem,即使它不在 Gemfile 中

标签 sqlite heroku ruby-on-rails-3.1 bundler

我第一次尝试在 Heroku 上部署 Rails 3.1 应用程序。我将它设置为 Cedar 堆栈,删除了 sqlite3 gem,但是当我将代码推送到 Heroku 时,出现此错误:

-----> Installing dependencies using Bundler version 1.1.rc Running: bundle install --without development:test --path vendor/bundle --deployment Fetching gem metadata from http://rubygems.org/....... (...)

Installing rails (3.1.0) Installing sqlite3 (1.3.4) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks! /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /usr/local/bin/ruby extconf.rb checking for sqlite3.h... no

我不知道为什么 bundle install 会尝试安装 sqlite3。看看我的 Gemfile 和 Gemfile.lock:

gem 文件

source 'http://rubygems.org'

gem 'rails', '3.1.0'

gem 'json'
gem 'pg'
gem 'thin'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
#  gem 'sass-rails', "  ~> 3.1.0"
#  gem 'coffee-rails', "~> 3.1.0"
  gem 'uglifier'
end

gem 'jquery-rails'

Gemfile.lock

GEM   remote: http://rubygems.org/   specs:
    actionmailer (3.1.0)
      actionpack (= 3.1.0)
      mail (~> 2.3.0)
    actionpack (3.1.0)
      activemodel (= 3.1.0)
      activesupport (= 3.1.0)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      i18n (~> 0.6)
      rack (~> 1.3.2)
      rack-cache (~> 1.0.3)
      rack-mount (~> 0.8.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.0.0)
    activemodel (3.1.0)
      activesupport (= 3.1.0)
      bcrypt-ruby (~> 3.0.0)
      builder (~> 3.0.0)
      i18n (~> 0.6)
    activerecord (3.1.0)
      activemodel (= 3.1.0)
      activesupport (= 3.1.0)
      arel (~> 2.2.1)
      tzinfo (~> 0.3.29)
    activeresource (3.1.0)
      activemodel (= 3.1.0)
      activesupport (= 3.1.0)
    activesupport (3.1.0)
      multi_json (~> 1.0)
    arel (2.2.1)
    bcrypt-ruby (3.0.1)
    builder (3.0.0)
    daemons (1.1.4)
    erubis (2.7.0)
    eventmachine (0.12.10)
    execjs (1.2.9)
      multi_json (~> 1.0)
    hike (1.2.1)
    i18n (0.6.0)
    jquery-rails (1.0.14)
      railties (~> 3.0)
      thor (~> 0.14)
    json (1.6.1)
    mail (2.3.0)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.16)
    multi_json (1.0.3)
    pg (0.11.0)
    polyglot (0.3.2)
    rack (1.3.3)
    rack-cache (1.0.3)
      rack (>= 0.4)
    rack-mount (0.8.3)
      rack (>= 1.0.0)
    rack-ssl (1.3.2)
      rack
    rack-test (0.6.1)
      rack (>= 1.0)
    rails (3.1.0)
      actionmailer (= 3.1.0)
      actionpack (= 3.1.0)
      activerecord (= 3.1.0)
      activeresource (= 3.1.0)
      activesupport (= 3.1.0)
      bundler (~> 1.0)
      railties (= 3.1.0)
    railties (3.1.0)
      actionpack (= 3.1.0)
      activesupport (= 3.1.0)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (~> 0.14.6)
    rake (0.9.2)
    rdoc (3.9.4)
    sprockets (2.0.0)
      hike (~> 1.2)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    thin (1.2.11)
      daemons (>= 1.0.9)
      eventmachine (>= 0.12.6)
      rack (>= 1.0.0)
    thor (0.14.6)
    tilt (1.3.3)
    treetop (1.4.10)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.29)
    uglifier (1.0.3)
      execjs (>= 0.3.0)
      multi_json (>= 1.0.2)

PLATFORMS   ruby

DEPENDENCIES   jquery-rails   json   pg   rails (= 3.1.0)   thin   uglifier

我该如何解决?

最佳答案

当我遇到这个问题时,结果是我忘记在 bundle install 之后提交我的更改。呸! git status 应该指示 gem 文件的未暂存更改。

关于sqlite - Heroku 正在尝试安装 sqlite3 gem,即使它不在 Gemfile 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7786509/

相关文章:

android - 将数据保存在本地存储,并在手机在线时将其发送到服务器

c++ - sqlite c++ 和 unsigned int key

python - 在 heroku 中启动应用程序?什么是程序文件? 'web:' 命令?

javascript - Rails 4 - javascript 文件未在生产中加载但在本地运行良好。 (英雄)

ruby-on-rails - Rails 应用程序中包含 Javascript 的问题

ruby-on-rails - 如何使用 passenger 在 Nginx 服务器上部署 Rails 项目?

python - 没有这样的表 : main. auth_user__old

android - 使用 SimpleDateFormat 转换 Sqlite 列日期格式

ruby - 轨道 3.1 : Upgrading caused my link_to path routes to break?

ruby-on-rails-3.1 - 有选择地禁用 Rails 3 中的 asset.digest,以便外部站点可以包含样式表