Rait错误与Git推Heroku的主错误

Rait错误与Git推Heroku的主错误

本文介绍了Rait错误与Git推Heroku的主错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力将我的git推向heroku。为此我使用:

  $ git push heroku master 

return:

remote:--without-sqlite3-lib = $ {sqlite3-lib = $ sqlite3-lib = $ {src = dir} / remote:remote:remote:Gem文件将保留安装在/tmp/build_ae596310505cf83afbb45a2986208c96/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11 for inspection.remote:记录到/ tmp / build_ae596310505cf83afbb45a2986208c96 / vendor / bundle / ruby​​ / 2.0.0 / gems / sqlite3-1.3.11 / ext / sqlite3 / gem_make.outremote:安装sqlite3(1.3.11)时发生错误,Bundler无法注销:continue.remote:确保`在bundleling.remote:!remote:gem install sqlite3 -v'1.3.11'`前成功!无法通过Bundler.remote安装gems:!遥控器:!检测到Heroku.remote不支持的sqlite3 gem:! https://devcenter.heroku.com/articles/sqlite3remote:!remote:remote:!推送被拒绝,未能编译Ruby appremote:remote:验证部署... remote:remote:!推拒绝冰川 - taiga-8832.remote:到https://git.heroku.com/glacial-taiga-8832.git! [remote rejected] master - > master(pre-receive hook refused)错误:未能将一些文件推送到'https://git.heroku.com/glacial-taiga-8832.git'

  

$ 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的主错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 14:34