问题描述
试图弄清楚这一点,我一直坚持了一个星期。我目前一直在关注在线讲座,但是我完全遵循了一切,讲师并没有任何帮助。每当我尝试推送到heroku时,我都会收到以下内容:我试着重建gem文件,删除gemfile.lock并运行bundle安装程序,解决了以前的问题,但我仍然得到这个错误。
这是我目前的gemFile:
source' https://rubygems.org'
gem'rails','3.2.13'
#Bundle edge Rails改为:
#gem'rails', :git => 'git://github.com/rails/rails.git'
gem'sqlite3'
#仅用于资产而不需要的宝石
#在生产环境中默认。
group:assets do
gem'sass-rails','〜> 3.2.3'
gem'咖啡栏','〜> 3.2.1'
#请参阅https://github.com/sstephenson/execjs#readme了解更多受支持的运行时间
#gem'therubyracer',:platforms => :ruby
gem'uglifier','> = 1.0.3'
结束
gem'jquery-rails'
#使用ActiveModel has_secure_password
#gem'bcrypt-ruby','〜> 3.0.0'
#为JSON使用Jbuilder模板
#gem'jbuilder'
使用独角兽作为应用服务器
#gem' unicorn'
#使用Capistrano进行部署
#gem'capistrano'
#使用调试器
#gem'debugger'
group:development do
gem'sqlite3'
gem'rspec-rails','2.6.1',:require => 'rspec-rails'
gem'faker','0.3.1'
end
group:test do
gem'sqlite3'
gem' rspec-rails','2.6.1',:require => 'rpec-rails'
gem'webrat','0.7.1'
gem'factory_girl_rails','1.0'
gem'turn',:require => false
end
group:production do
gem'pg'
end
对此有何帮助?
我会推荐几件事情:
$ b 1) 的说明来处理 Gemfile 问题在部署在Windows上生成的Ruby项目时出现。
2)在您的Gemfile中执行以下操作
group:test::production do
gem'pg'
end
group:development do
gem'sqlite3'
结束
这样可以避免 sqlite3
从您的生产部署。使用它进行单元和集成测试,但使用PostgreSQL进行验收/功能测试,因为这是Heroku所选择的RDBMS。 3)设置在Heroku的部署环境中。
I have been stuck for a week trying to figure this out. I have currently been following online lectures, however I followed everything exactly, and the instructor isn't really of any help. Whenever I try to push to heroku I receive the following:
I have tried rebuilding the gem files, deleting gemfile.lock and running bundle installer, following solution from previous questions, but I am still getting this error.
Here is my current gemFile:
source 'https://rubygems.org'
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
group :development do
gem 'sqlite3'
gem 'rspec-rails', '2.6.1', :require => 'rspec-rails'
gem 'faker', '0.3.1'
end
group :test do
gem 'sqlite3'
gem 'rspec-rails', '2.6.1', :require => 'rpec-rails'
gem 'webrat', '0.7.1'
gem 'factory_girl_rails', '1.0'
gem 'turn', :require => false
end
group :production do
gem 'pg'
end
Any help on this?
I would recommend a few things:
1) Follow the instructions here to deal with the Gemfile issues that arise when deploying a Ruby project generated on Windows.
2) Do the following in your Gemfile
group :test, :production do
gem 'pg'
end
group :development do
gem 'sqlite3'
end
This gets rid of sqlite3
from your production deployment. Use it for unit and integration testing, but use PostgreSQL for acceptance/functional testing because that's the RDBMS of choice on Heroku. Also, reference your gems only once each.
3) Set up the Hobby Dev version of the PostgreSQL add-on in your deployment environment on Heroku.
这篇关于Heroku:推送被拒绝,未能编译Ruby应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!