错误解析Gemfile;无法部署到Heroku

时间:2014-10-09 14:52:27

标签: ruby-on-rails ruby git heroku

很难推到heroku。我使用最新版本的rails和ruby。每次我尝试上传到heroku时都会收到此消息。 [码] $ git push heroku master 警告:永久添加用于IP地址的RSA主机密钥' 50.19.85.132'到已知主机列表。 初始化存储库,完成。 计数对象:69,完成。 Delta压缩使用多达8个线程。 压缩对象:100%(58/58),完成。 书写对象:100%(69/69),15.99 KiB | 0字节/秒,完成。 总计69(delta 5),重用0(delta 0)

-----> Ruby app detected
-----> Compiling Ruby/Rails
/app/tmp/buildpacks/ruby/lib/language_pack/helpers/bundler_wrapper.rb:88:in `block in           ruby_version': There was an error parsing your Gemfile, we cannot continue        (LanguagePack::Helpers::BundlerWrapper::GemfileParseError)
There was an error in your Gemfile, and Bundler cannot continue.
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:18:in `block (2 levels) in        instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:40:in     `yield_with_block_depth'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:17:in `block in instrument'
from /app/vendor/ruby-1.9.2/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:16:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/helpers/bundler_wrapper.rb:76:in      `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/helpers/bundler_wrapper.rb:80:in   `ruby_version'
from /app/tmp/buildpacks/ruby/lib/language_pack/ruby.rb:180:in `block in ruby_version'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:18:in `block (2 levels) in     instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:40:in  `yield_with_block_depth'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:17:in `block in instrument'
from /app/vendor/ruby-1.9.2/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:16:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:47:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:43:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/ruby.rb:173:in `ruby_version'
from /app/tmp/buildpacks/ruby/lib/language_pack/ruby.rb:259:in `block in install_ruby'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:18:in `block (2 levels) in   instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:17:in `block in instrument'
from /app/vendor/ruby-1.9.2/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:16:in `instrument' 
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:47:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:43:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/ruby.rb:258:in `install_ruby'
from /app/tmp/buildpacks/ruby/lib/language_pack/ruby.rb:88:in `block in compile'  
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:18:in `block (2 levels) in  instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:17:in `block in instrument'
from /app/vendor/ruby-1.9.2/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:16:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:47:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:43:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/ruby.rb:83:in `compile'
from /app/tmp/buildpacks/ruby/lib/language_pack/rails2.rb:49:in `block in compile'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:18:in `block (2 levels) in   instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:17:in `block in instrument' 
from /app/vendor/ruby-1.9.2/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:16:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:47:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:43:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/rails2.rb:47:in `compile'
from /app/tmp/buildpacks/ruby/lib/language_pack/rails3.rb:38:in `block in compile'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:17:in `block in instrument'
from /app/vendor/ruby-1.9.2/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:16:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:47:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:43:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/rails3.rb:37:in `compile'
from /app/tmp/buildpacks/ruby/lib/language_pack/rails4.rb:41:in `block in compile'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:18:in `block (2 levels) in  instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:17:in `block in instrument'
from /app/vendor/ruby-1.9.2/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:16:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:47:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:43:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/rails4.rb:40:in `compile'
from /app/tmp/buildpacks/ruby/bin/compile:15:in `block (2 levels) in <main>'
from /app/tmp/buildpacks/ruby/lib/language_pack/base.rb:124:in `log'
from /app/tmp/buildpacks/ruby/bin/compile:14:in `block in <main>'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:35:in `call'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:35:in `block in trace'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument' 
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:17:in `block in instrument'
from /app/vendor/ruby-1.9.2/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:16:in `instrument'
from /app/tmp/buildpacks/ruby/lib/language_pack/instrument.rb:35:in `trace'
from /app/tmp/buildpacks/ruby/bin/compile:10:in `<main>'

 !     Push rejected, failed to compile Ruby app

To git@heroku.com:aqueous-crag-8467.git
 ! [remote rejected] master -> master (pre-receive hook declined)
 error: failed to push some refs to 'git@heroku.com:aqueous-crag-8467.git'
 Richards-MacBook-Pro-2:hockeyapp richardlane$ bundle --version
Bundler version 1.7.3
[/code]

这是我的gemfile:

    # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '4.1.6' 

# Use sqlite3 as the database for Active Record



group :production do

    gem 'pg'

end



group :development do

    gem 'sqlite3'

end





# Use SCSS for stylesheets

gem 'sass-rails', '~> 4.0.3'

# Use Uglifier as compressor for Javascript assets

gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views

gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes

# gem 'therubyracer',  platforms: :ruby



# Use jquery as the Javascript library

gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more:            https://github.com/rails/turbolinks

gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder

gem 'jbuilder', '~> 2.0'

# bundle exec rake doc:rails generates the API under doc/api.

gem 'sdoc', '~> 0.4.0',          group: :doc



# Spring speeds up development by keeping your application running in the background. Read      more: https://github.com/rails/spring

gem 'spring',        group: :development

[/代码]

3 个答案:

答案 0 :(得分:1)

我认为您需要在gemfile中添加以下代码

gem 'rails_12factor', group: :production
ruby "2.1.1"

您可以按照这些步骤进行操作

https://devcenter.heroku.com/articles/getting-started-with-rails4

答案 1 :(得分:1)

对于 Rails&#39; 4.1.6&#39; 版本,所需的 Ruby 版本必须大于或等于(&gt; = < / strong>) 1.9.3

所以添加任何ruby版本,如1.9.3p2,1.9.3-p547,2.0.0-p576,2.1.1等;

答案 2 :(得分:0)

Heroku遇到API问题https://status.heroku.com/ https://status.heroku.com/incidents/673并暂时禁用了API访问权限。

这可能是问题的一部分,因为目前无法通过CLI或Heroku Dashboard部署,提取或更新应用程序。