heroku推被拒绝,无法编译Ruby / rails应用程序
有以下问题,BRAND NEW TO 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 error: failed to push some refs to 'git@heroku.com:peaceful-chamber-6371.git
gem文件
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'
试试这个,
删除Gemfile.lock
文件并进行bundle install
,然后git add
, git commit
和git push
。
看看Heroku写入控制台的所有输出 – 你的错误很可能就在那里。 我碰到了这个,发现预编译步骤失败了。 这也可以在本地运行:
rake assets:precompile
虽然这个问题已经得到了答案,但答案对我没有帮助,我遇到了同样的问题。 以下对我有用,因此有所贡献。 Heroku不支持sqlite 3.在这种情况下,我在我的gemfile中有sqlite3 gem,你应该将它放在开发组中,并将postgres gem(heroku支持)放在生产组中。
1)删除gemfile.lock文件(从项目文件夹中)
2)在gemfile中,删除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
虽然这是一个愚蠢的错误,但我花了很多时间才意识到这一点。 希望它可以帮到某人。
由于Rails 4不支持插件,Heroku的资产插件不再有效。 你需要使用Heroku的资产gem。 将它放在你的Gemfile中:
group :production do gem 'rails_12factor' end
在这里找到的答案: Heroku不会在Rails 4中的资产管道下编译文件
我的问题是我在.gitignore中忽略了我的凉亭目录。
所以我需要从我的packages.json做bower安装或检查我的凉亭目录。
http://xseignard.github.io/2013/02/18/use-bower-with-heroku/
我现在选择检查我的凉亭目录以获得快速解决方案。
Heroku不喜欢sqlite3,用gem 'sqlite3'
更改gem 'sqlite3'
gem 'pg'