Rails 4 - Heroku Sqlite3错误

时间:2013-07-05 21:21:32

标签: ruby-on-rails ruby heroku

我和Herouku有点麻烦。由于以下错误,我无法推送:

Gem files will remain installed in  /tmp/build_2jdec30lsc3bu/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.7 for inspection.
       Results logged to /tmp/build_2jdec30lsc3bu/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out
       An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
       Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !     
 !     Detected sqlite3 gem which is not supported on Heroku.
 !     https://devcenter.heroku.com/articles/sqlite3
 !

 !     Push rejected, failed to compile Ruby/Rails app

我无法解决它。

我尝试了以下内容:

group :development, :test do
  gem 'sqlite3'
end

group :production do
  gem 'pg'
end

我一直得到同样的错误。我甚至试图完全删除sqlite3。同样恼人的错误。我确保在运行git push heroku master之前推送我的更改。有任何想法吗?或者我可能会放弃Heroku ......

2 个答案:

答案 0 :(得分:2)

我之前遇到过类似的问题。这在我的Gemfile中适用于我:

gem 'sqlite3', group: [:development, :test]
gem 'pg', group: [:production]

此外,在您的本地git checkout中,执行命令heroku config。确认输出设置了以下环境变量:

RACK_ENV:                     production
RAILS_ENV:                    production

试一试。它对你有用吗?

答案 1 :(得分:0)

这个怎么样?

heroku rake db:reset
heroku rake db:migrate