我刚刚将项目升级到5.1.4,并修复了本地主机上的所有问题。我现在正在推进我的临时环境,并在推送到Heroku时遇到此错误。
remote: Removing activerecord-import (0.19.1)
remote: Removing actionmailer (4.2.3)
remote: -----> Installing node-v6.11.1-linux-x64
remote: -----> Detecting rake tasks
remote: sh: 2: Syntax error: Unterminated quoted string
remote: sh: 2: Syntax error: Unterminated quoted string
remote: !
remote: ! Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the production group of your Gemfile.
remote: ! rake aborted!
remote: ! LoadError: cannot load such file -- netaddr
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/email_address-0.1.7/lib/email_address/exchanger.rb:2:in `<top (required)>'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/email_address-0.1.7/lib/email_address.rb:5:in `<module:EmailAddress>'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/email_address-0.1.7/lib/email_address.rb:2:in `<top (required)>'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:82:in `require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:82:in `block (2 levels) in require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:77:in `each'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:77:in `block in require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:66:in `each'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:66:in `require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler.rb:108:in `require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/config/application.rb:8:in `<top (required)>'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/Rakefile:4:in `require'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/Rakefile:4:in `<top (required)>'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load_rakefile'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/rake-12.3.0/lib/rake/application.rb:703:in `raw_load_rakefile'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/rake-12.3.0/lib/rake/application.rb:104:in `block in load_rakefile'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/rake-12.3.0/lib/rake/application.rb:103:in `load_rakefile'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/rake-12.3.0/lib/rake/application.rb:82:in `block in run'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
remote: ! /tmp/build_1857c4cf922c4c07f51dada80913d8f8/vendor/bundle/ruby/2.2.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
remote: ! vendor/bundle/bin/rake:17:in `load'
remote: ! vendor/bundle/bin/rake:17:in `<main>'
remote: !
remote: /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
remote: ensure you can run `$ bundle exec rake -P` against your app
remote: and using the production group of your Gemfile.
remote: rake aborted!
我尝试按照它的建议运行bundle exec rake -P
,我没有错误。任何人都知道这个问题是什么或我如何开始排除故障?
答案 0 :(得分:2)
我建议你看一下你的/config/application.rb:8
。可能存在问题,可能是netaddr
文件。
要进行疑难解答,您可以执行rails console
。在使用rails server
时它会引发错误,它可能会忽略代码中的错误,直到它完全执行该代码。