【发布时间】:2011-12-08 20:20:04
【问题描述】:
我第一次尝试在 Heroku 上部署 Rails 3.1 应用程序。我将它设置为 Cedar 堆栈,删除了 sqlite3 gem,但是当我将代码推送到 Heroku 时,出现此错误:
-----> 使用 Bundler 版本 1.1.rc 安装依赖项 运行: bundle install --without development:test --path vendor/bundle --deployment 正在从 http://rubygems.org/....... 获取 gem 元数据 (...)
安装导轨 (3.1.0) 使用本机扩展安装 sqlite3 (1.3.4) 不幸的是,发生了致命错误。请将此错误报告给 Bundler 问题跟踪器位于 https://github.com/carlhuda/bundler/issues 以便我们修复它。 谢谢! /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions':错误:无法构建 gem native 延期。 (Gem::Installer::ExtensionBuildError) /usr/local/bin/ruby extconf.rb 检查 sqlite3.h... 否
我不知道为什么 bundle install 试图安装 sqlite3。看看我的 Gemfile 和 Gemfile.lock:
宝石文件
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
我该如何解决?
【问题讨论】:
-
那么,投反对票的聪明人能解释一下原因吗?
-
我遇到了同样的问题,我在本地使用 'pg' 没有问题,但 Heroku 仍在尝试安装 sqlite,因此出错。但是,我可以看到我的 gemfile.lock 中有以下内容:
sqlite3 (1.3.4) sqlite3-ruby (1.3.3) sqlite3 (>= 1.3.3)。这些显然是导致问题的原因,但我无法弄清楚为什么它们仍在进入我的 gemfile.lock;无论我做多少次bundle update或删除锁定文件并从头开始。有什么建议吗? -
我已经通过从我的 Gemfile 中删除
tapsgem 来修复我的问题。忘了我在实际的 Gemfile 中不需要它,只是在我的 gemset 中才能使用它。删除taps删除了我 Gemfile.lock 中的 sqlite 依赖项。 -
谢谢皮特,移除水龙头(在我的情况下,水龙头水龙头)对我有用:)
标签: sqlite heroku ruby-on-rails-3.1 bundler