当我这样做时
git push heroku master
我收到以下消息:
An error occurred while installing sqlite3-ruby (1.2.5), and Bundler cannot continue.
Make sure that `gem install sqlite3-ruby -v '1.2.5'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
我已经安装了 libsqlite3-dev、libsqlite3-0、sqlite3,当我运行时:
gem install sqlite3-ruby -v '1.2.5'
按照错误信息的提示,安装成功:
Successfully installed sqlite3-ruby-1.2.5
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.5...
Installing RDoc documentation for sqlite3-ruby-1.2.5...
我不确定可能是什么问题。
我的 Gemfile 是:
source 'http://rubygems.org'
gem 'rails', '3.0.1'
gem 'sqlite3-ruby', '1.2.5',:require => 'sqlite3'
我可以知道是什么问题以及如何解决它吗?
最佳答案
Heroku 不支持 sqlite3。
所以您需要将 Gemfile 更改为:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
然后再次运行 bundle install
关于ruby-on-rails-3 - heroku 推送失败,错误为 "An error occurred while installing sqlite3-ruby (1.2.5)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11714336/