3

命令:git push heroku master

留言

Counting objects: 187, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (165/165), done.
Writing objects: 100% (187/187), 41.33 KiB, done.
Total 187 (delta 50), reused 0 (delta 0)

-----> Heroku receiving push
-----> Ruby/Rails app detected
sh: Syntax error: Unterminated quoted string
 !
 !     Invalid RUBY_VERSION specified: <internal:lib/rubygems/custom_require>:29:in-`require':-no-such-file-to-load----execjs-LoadError-<internal:lib/rubygems/custom_require>:29:in-`require'-/tmp/build_60rm0lhvvqx7/Gemfile:1:in-`eval_gemfile'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/lib/bundler/dsl.rb:32:in-`instance_eval'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/lib/bundler/dsl.rb:32:in-`eval_gemfile'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/lib/bundler/dsl.rb:7:in-`evaluate'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/lib/bundler/definition.rb:18:in-`build'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/lib/bundler.rb:142:in-`definition'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/lib/bundler/cli.rb:633:in-`platform'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/lib/bundler/vendor/thor/task.rb:22:in-`run'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/lib/bundler/vendor/thor/invocation.rb:118:in-`invoke_task'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/lib/bundler/vendor/thor.rb:263:in-`dispatch'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/lib/bundler/vendor/thor/base.rb:386:in-`start'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/bin/bundle:13:in-`<top-(required)>'-/tmp/bundler-20120607-470-s30ash/bin/bundle:19:in-`load'-/tmp/bundler-20120607-470-s30ash/bin/bundle:19:in-`<main>'-There-was-an-error-in-your-Gemfile,-and-Bundler-cannot-continue.
 !     Valid versions: ruby-1.9.3-p0, ruby-1.9.3-p125, rbx-1.2.4, rbx-2.0.0dev-20120115-1.9, rbx-2.0.0dev-20120115-1.8, rbx-2.0.0dev-20120123-1.9, rbx-2.0.0dev-20120123-1.8, ruby-1.9.2-p290, jruby-1.6.5.1, jruby-1.6.7, ruby-1.9.3, ruby-1.9.2
 !
    sh: Syntax error: Unterminated quoted string
 !     Heroku push rejected, failed to compile Ruby/rails app

    To git@heroku.com:blazing-fire-8664.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:blazing-fire-8664.git'
vantan08@hart-D820:~/rails_projects/sample_app$ Invalid RUBY_VERSION specified: <internal:lib/rubygems/custom_require>:29:in-`require':-no-such-file-to-load----execjs-LoadError-<internal:lib/rubygems/custom_require>:29:in-`require'-/tmp/build_1b5u4o8udl3vu/Gemfile:1:in-`eval_gemfile'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/dsl.rb:32:in-`instance_eval'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/dsl.rb:32:in-`eval_gemfile'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/dsl.rb:7:in-`evaluate'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/definition.rb:18:in-`build'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler.rb:142:in-`definition'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/cli.rb:633:in-`platform'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/vendor/thor/task.rb:22:in-`run'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/vendor/thor/invocation.rb:118:in-`invoke_task'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/vendor/thor.rb:263:in-`dispatch'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/vendor/thor/base.rb:386:in-`start'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/bin/bundle:13:in-`<top-(required)>'-/tmp/bundler-20120607-4420-16eeuqu/bin/bundle:19:in-`load'-/tmp/bundler-20120607-4420-16eeuqu/bin/bundle:19:in-`<main>'-There-was-an-error-in-your-Gemfile,-and-Bundler-cannot-continue.
bash: syntax error near unexpected token `('
4

3 回答 3

4

对于其他登陆这里的人...

我有同样的错误,就我而言,这是因为我的 Gemfile 中的错误。

导致错误的 Gemfile:

source "http://rubygems.org"
require 'gem-name-here'
require 'another-gem-here'

应该是:

source "http://rubygems.org"
gem 'gem-name-here'
gem 'another-gem-here'

(我从我正在处理的 ruby​​ 脚本文件中复制了“require”行,但忘记将它们改为“gem”。)

于 2013-01-27T20:54:35.133 回答
0

我的错误是由 rake 任务引起的弃用评论。我可以通过以下方式触发弃用错误:

rake assets:precompile --dry-run

修复 rake 任务(或只是将其注释掉)修复了 Heroku 部署。

于 2016-04-20T01:20:24.197 回答
0

我花了半天时间才意识到我已经添加了一个 gem,它有一个 .yml 文件,其中包含针对不同环境的配置。我忘记了我的 Heroku 环境是我创建的称为“staging”的自定义环境,而 .yml 文件没有定义它。

于 2016-10-07T12:09:21.820 回答