问题描述
我正在努力将我的git推向heroku。为此我使用:
$ git push heroku master
return:
$ sudo gem install sqlite3 -v'1.3.11'
它可以工作,但是同样的问题。
任何人都可以提供帮助吗?
您需要将 sqlite3
gem放入Gemfile的开发
部分。 Heroku没有安装SQLite数据库。
示例:
group:development,:test do
gem'sqlite3'
end
要在Heroku上使用数据库,您需要使用PostgreSQL数据库(默认情况下)。为了使它工作,您需要将 pg
gem添加到生产
组中:
group:production do
gem'pg'
end
另外,有一些机会需要更新你的 database.yml
,但我相信Heroku会注入它们数据库连接设置在您的配置文件中。
I'm trying to push my git on heroku. For this i use :
$ git push heroku master
return :
remote: --without-sqlite3-lib=${sqlite3-dir}/
remote:
remote:
remote: Gem files will remain installed in /tmp/build_ae596310505cf83afbb45a2986208c96/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11 for inspection.
remote: Results logged to /tmp/build_ae596310505cf83afbb45a2986208c96/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11/ext/sqlite3/gem_make.out
remote: An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Detected sqlite3 gem which is not supported on Heroku.
remote: ! https://devcenter.heroku.com/articles/sqlite3
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to glacial-taiga-8832.
remote:
To https://git.heroku.com/glacial-taiga-8832.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/glacial-taiga-8832.git'
If i do :
$ sudo gem install sqlite3 -v '1.3.11'
it works but same problem.Anyone can help?
You need to move the sqlite3
gem into the development
section of your Gemfile. Heroku doesn't have the SQLite database installed.
Example:
group :development, :test do
gem 'sqlite3'
end
To use the database on Heroku you need to use PostgreSQL database (by default). To make it work you need to add the pg
gem into the production
group:
group :production do
gem 'pg'
end
Also, there are some chances that you will need to update your database.yml
, but I believe Heroku will just inject their database connection setting in your config file.
这篇关于Rait错误与Git推Heroku的主错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!