命令: 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 `('
答案 0 :(得分: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”而不是。)
答案 1 :(得分:0)
我的错误是由rake任务引起的弃用评论。我可以通过以下方式触发弃用错误:
rake assets:precompile --dry-run
修复rake任务(或只是将其注释掉)修复了Heroku部署。
答案 2 :(得分:0)
我在这上花了半天时间,意识到我添加了一个带有.yml文件的gem,其中包含针对不同环境的配置。我忘记了我的Heroku环境是我创建的一个自定义环境,称为&#34; staging&#34;并且.yml文件没有定义它。