Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我正在尝试git推heroku,但得到了下面相同的错误_Heroku_Push - Fatal编程技术网

我正在尝试git推heroku,但得到了下面相同的错误

我正在尝试git推heroku,但得到了下面相同的错误,heroku,push,Heroku,Push,命令: git推送heroku主机 消息: 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 receiv

命令: git推送heroku主机

消息

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 `('
计数对象:187,完成。
增量压缩最多使用2个线程。
压缩对象:100%(165/165),完成。
书写对象:100%(187/187),41.33千磅,完成。
总计187(增量50),重复使用0(增量0)
----->Heroku接受推送
----->检测到Ruby/Rails应用程序
sh:语法错误:未终止的引号字符串
!
!     指定的RUBY\u版本无效::29:in-`require':-没有这样的文件要加载----execjs LoadError-:29:in-`require'-/tmp/build\u 60rm0lhvvvqx7/Gemfile:1:in-`eval\u-Gemfile'-/tmp/bundler-20120607-470-s30ash/gems/bundler-1.2.0.pre/lib/bundler/dsl.rb:32:in-`instance\u-eval'-/bundler-20120607-470-470-s30ash/gems/bundler-1.2.0.0.pre/dsl-/bundler-201207070ash/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-201207-470-s30ash/lib/bundler.630-1.com.com-/bundlerundler-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/thor/bundler-2630b-/bundler-2630b-/bundler-263undler-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/bundler:13:in-`tmp/bundler-20120607-470-s30ash/bin/bundle:19:in-`load'-/tmp/bundler-20120607-470-s30ash/bin/bundle:19:in'-您的gem文件中有错误,bundler无法继续。
!     有效版本:ruby-1.9.3-p0,ruby-1.9.3-p125,rbx-1.2.4,rbx-2.0.0dev-20115-1.9,rbx-2.0.0dev-20115-1.8,rbx-2.0.0dev-20123-1.9,rbx-2.0.0dev-20120123-1.8,ruby-1.9.2-p290,jruby-1.6.7,ruby-1.9.3,ruby-1.9.2
!
sh:语法错误:未终止的引号字符串
!     Heroku push被拒绝,未能编译Ruby/rails应用程序
到git@heroku.com:blazing-fire-8664.git
! [远程拒绝]主机->主机(拒绝预接收挂钩)
错误:无法将某些引用推送到'git@heroku.com:blazing-fire-8664.git'
vantan08@hart-D820:~/rails\u项目/sample\u应用程序$指定的RUBY\u版本无效::29:in-'require':-没有这样的文件要加载----execjs LoadError-:29:in-'require'-/tmp/build1b5u4o8udl3vu/Gemfile:1:in-'eval_-Gemfile'-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/dsl.rb:32:in-'instance_-eval'-/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0/dsl-201207420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/dsl.rb:7:in-‘评估’-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler/definition.rb:18:in-‘构建’-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.pre/lib/bundler.rb:142:in-‘定义’-/tmp/bundler-201207-16eeuqu/pla/bundlertform'-/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-'invocate_-task-/tmp/bundler-20120607-4420-16eeuqu/gems/bundler-1.2.0.2.0.0.html-/bundler-26307-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-`tmp/bundler-20120607-4420-16eeuqu/bin/bundle:19:in-`load'-/tmp/bundler-20120607-4420-eeuqu/bundler-19:in-`文件中有错误,无法继续。
bash:意外标记“(”附近出现语法错误

对于在这里登陆的其他人

我有同样的错误,在我的情况下,这是因为我的GEM文件中的错误

导致错误的文件:

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”。

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

rake assets:precompile --dry-run

修复rake任务(或只是对其进行注释)修复了Heroku部署。

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

也有同样的问题,有什么线索吗?