有以下问题,全新的RoR,第一次尝试上传应用程序上线,首先有托管问题,然后决定如果我可以用heroku修复它们,我将只使用heroku的自定义域名......不,这不是一个测试应用程序“学习rails”的事情,实际的应用程序,我想部署在我自己的业务中使用,任何帮助都会很好,我已经搜索过了,还没有看到这个问题的解决方案。
在捆绑之前,请确保'gem install sqlite3 -v 1.3.7‘成功。
Failed to install gems via Bundler
Heroku push rejected, failed to compile Ruby/rails app
To git@heroku.com:peaceful-chamber-6371.git
[remote rejected] master -> master <pre-receive hook declined>
error: failed to push some refs to 'git@heroku.com:peaceful-chamber-6371.git
宝石文件
source 'https://rubygems.org'
gem 'rails', '3.2.12'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
# 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'
gem 'twitter-bootstrap-rails'
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'
发布于 2013-04-01 11:44:27
尝尝这个,
删除Gemfile.lock
文件并执行bundle install
,然后是git add
、git commit
和git push
。
发布于 2013-10-10 19:41:26
看一下Heroku写到控制台的所有输出--您的错误很可能出在某个地方。我遇到了这个问题,发现预编译步骤失败了。也可以在本地运行:
rake assets:precompile
发布于 2015-10-09 23:01:22
虽然这个问题有一个公认的答案,但答案对我没有帮助,我也有同样的问题。下面的内容对我很有效,因此做出了贡献。Heroku不支持sqlite3。在这种情况下,我在我的gemfile中有postgres gem,你应该将它放在开发组中,并将postgres gem ( heroku支持的)放在production组中。
1)删除gemfile.lock文件(从项目文件夹中)
2)在gem文件中,删除gem sqlite3
或类似的sqlite3 gem
3)而不是在文件末尾添加以下内容:
group :development, :test do
gem 'sqlite3'
end
gem 'pg', group: :production`
现在,在终端中运行以下命令:
bundle install
git add .
git commit
git push
git push heroku master
虽然这是一个愚蠢的错误,但我花了一段时间才意识到这一点。希望这能帮助到别人。
https://stackoverflow.com/questions/15737296
复制相似问题