[英]Something wrong when git push heroku master
when I "git push heroku master" return some information like this: 当我“ git push heroku master”返回以下信息:
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 serene-fjord-6086.
remote:
To https://git.heroku.com/serene-fjord-6086.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/serene-fjord-6086.git'
but I have installed sqlite3 -v '1.3.11' successfully 但是我已经成功安装了sqlite3 -v'1.3.11'
Building native extensions. This could take a while...
Successfully installed sqlite3-1.3.11
1 gem installed
This is the Gemfile and I have tried adding "gem sqlite3" in "group :development,:test", but it doesn't work: 这是Gemfile,我尝试在“ group:development,:test”中添加“ gem sqlite3”,但它不起作用:
source 'https://rubygems.org'
gem 'rails', '4.2.4'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
group :production do
gem 'pg','0.17.1'
gem 'rails_12factor','0.0.2'
end
why ??????? 为什么???????
Heroku Use PG as database system, it won't support sqlite db. Heroku使用PG作为数据库系统,它将不支持sqlite db。 You should move sqlite gem in your gemfile inside testing, development group like this,
您应该在测试,开发小组这样的gemfile中移动sqlite gem,
source 'https://rubygems.org'
gem 'rails', '4.2.4'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
gem 'sqlite3'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
group :production do
gem 'pg','0.17.1'
gem 'rails_12factor','0.0.2'
end
Heroku didn't have this issue before, I think it used to ignored sqlite gem before. Heroku以前没有这个问题,我认为以前曾经忽略过sqlite gem。 I faced it while pushing a few days back.
我在退后几天时遇到了它。
Ideal solution is to put all your 'heroku non-supporting gems' inside :development & :test group in your Gemfile
理想的解决方案是将所有“ heroku不支持的宝石”放入
Gemfile
:development和:test组中
group :development, :test do
gem 'sqlite'
end
and keep your heroku gems inside :production group 并将您的heroku宝石保存在:production组中
group :production do
gem 'rails_12factor'
gem 'pg'
#anything else
end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.