繁体   English   中英

git的Rails错误推送heroku master错误

[英]Rails error with git push heroku master error

我正在尝试在heroku上推送我的git。 为此,我使用:

$ git push heroku master

返回:

 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' 

如果我做 :

$ sudo gem install sqlite3 -v '1.3.11'

它的工作原理相同。 有人可以帮忙吗?

您需要将sqlite3 gem移至Gemfile的development部分。 Heroku没有安装SQLite数据库。

例:

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

要在Heroku上使用数据库,您需要使用PostgreSQL数据库(默认情况下)。 为了使其正常工作,您需要将pg gem添加到production组中:

group :production do
  gem 'pg'
end

另外,您有可能需要更新database.yml ,但是我相信Heroku只会将其数据库连接设置注入到配置文件中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM