错误"未定义方法" load_defaults" "尝试在Heroku

时间:2017-05-05 21:07:33

标签: ruby-on-rails ruby heroku bundler

我是ruby和rails编程的新手,因此我一直在关注railstutorial.org在线书籍,并遇到了一个我几小时无法解决的障碍:

跑完" git push heroku master"在Bash中,我得到以下内容:

Counting objects: 90, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (76/76), done.
Writing objects: 100% (90/90), 21.30 KiB | 0 bytes/s, done.
Total 90 (delta 5), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote:  !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote:             Detected buildpacks: Ruby,Node.js
remote:             See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.3.4
remote: -----> Installing dependencies using bundler 1.13.7
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.6). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote:        Fetching gem metadata from https://rubygems.org/.........
remote:        Fetching version metadata from https://rubygems.org/..
remote:        Fetching dependency metadata from https://rubygems.org/.
remote:        Installing i18n 0.8.1
remote:        Installing rake 12.0.0
remote:        Installing concurrent-ruby 1.0.5
remote:        Installing minitest 5.10.1
remote:        Installing thread_safe 0.3.6
remote:        Installing builder 3.2.3
remote:        Installing erubis 2.7.0
remote:        Installing mini_portile2 2.1.0
remote:        Installing rack 2.0.1
remote:        Installing nio4r 1.2.1 with native extensions
remote:        Installing websocket-extensions 0.1.2
remote:        Installing mime-types-data 3.2016.0521
remote:        Installing arel 7.1.4
remote:        Installing coffee-script-source 1.12.2
remote:        Installing execjs 2.7.0
remote:        Installing method_source 0.8.2
remote:        Installing thor 0.19.4
remote:        Installing multi_json 1.12.1
remote:        Installing pg 0.18.4 with native extensions
remote:        Installing puma 3.4.0 with native extensions
remote:        Using bundler 1.13.7
remote:        Installing sass 3.4.23
remote:        Installing tilt 2.0.7
remote:        Installing turbolinks-source 5.0.3
remote:        Installing tzinfo 1.2.3
remote:        Installing nokogiri 1.7.1 with native extensions
remote:        Installing rack-test 0.6.3
remote:        Installing sprockets 3.7.1
remote:        Installing websocket-driver 0.6.5 with native extensions
remote:        Installing mime-types 3.1
remote:        Installing coffee-script 2.4.1
remote:        Installing uglifier 3.0.0
remote:        Installing turbolinks 5.0.1
remote:        Installing activesupport 5.0.1
remote:        Installing mail 2.6.5
remote:        Installing globalid 0.4.0
remote:        Installing activemodel 5.0.1
remote:        Installing jbuilder 2.4.1
remote:        Installing activejob 5.0.1
remote:        Installing activerecord 5.0.1
remote:        Installing rails-dom-testing 2.0.2
remote:        Installing loofah 2.0.3
remote:        Installing rails-html-sanitizer 1.0.3
remote:        Installing actionview 5.0.1
remote:        Installing actionpack 5.0.1
remote:        Installing actionmailer 5.0.1
remote:        Installing actioncable 5.0.1
remote:        Installing railties 5.0.1
remote:        Installing sprockets-rails 3.2.0
remote:        Installing rails 5.0.1
remote:        Installing coffee-rails 4.2.1
remote:        Installing jquery-rails 4.1.1
remote:        Installing sass-rails 5.0.6
remote:        Bundle complete! 16 Gemfile dependencies, 53 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Bundle completed (25.85s)
remote:        Cleaning up the bundler cache.
remote: -----> Installing node-v6.10.0-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:  !     NoMethodError: undefined method `load_defaults' for #<Rails::Application::Configuration:0x007fe95df68030>
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/railties-5.0.1/lib/rails/railtie/configuration.rb:95:in `method_missing'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/config/application.rb:12:in `<class:Application>'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/config/application.rb:10:in `<module:HelloApp>'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/config/application.rb:9:in `<top (required)>'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/Rakefile:4:in `require_relative'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/Rakefile:4:in `<top (required)>'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load_rakefile'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:687:in `raw_load_rakefile'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:96:in `block in load_rakefile'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:95:in `load_rakefile'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:79:in `block in run'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
remote:  !     /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.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:102: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!
remote: NoMethodError: undefined method `load_defaults' for #<Rails::Application::Configuration:0x007fe95df68030>
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/railties-5.0.1/lib/rails/railtie/configuration.rb:95:in `method_missing'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/config/application.rb:12:in `<class:Application>'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/config/application.rb:10:in `<module:HelloApp>'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/config/application.rb:9:in `<top (required)>'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/Rakefile:4:in `require_relative'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/Rakefile:4:in `<top (required)>'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load_rakefile'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:687:in `raw_load_rakefile'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:96:in `block in load_rakefile'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:95:in `load_rakefile'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:79:in `block in run'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
remote: /tmp/build_9d66aec07e51cd554443c45d6ce07bca/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
remote: vendor/bundle/bin/rake:17:in `load'
remote: vendor/bundle/bin/rake:17:in `<main>'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/ruby.rb:757:in `rake'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails4.rb:77:in `block (2 levels) in run_assets_precompile_rake_task'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:132:in `log'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails4.rb:71:in `block in run_assets_precompile_rake_task'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/vendor/ruby/cedar-14/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:49:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:45:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails4.rb:70:in `run_assets_precompile_rake_task'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/ruby.rb:109:in `block (2 levels) in compile'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/ruby.rb:778:in `allow_git'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/ruby.rb:103:in `block in compile'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/vendor/ruby/cedar-14/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:49:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:45:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/ruby.rb:92:in `compile'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails2.rb:57:in `block in compile'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/vendor/ruby/cedar-14/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:49:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:45:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails2.rb:55:in `compile'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails3.rb:42:in `block in compile'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/vendor/ruby/cedar-14/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:49:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:45:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails3.rb:41:in `compile'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails4.rb:41:in `block in compile'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/vendor/ruby/cedar-14/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:49:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:45:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails4.rb:40:in `compile'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/bin/support/ruby_compile:20:in `block (2 levels) in <main>'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:132:in `log'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/bin/support/ruby_compile:19:in `block in <main>'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:35:in `block in trace'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/vendor/ruby/cedar-14/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:35:in `trace'
remote:     from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/bin/support/ruby_compile:15:in `<main>'
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to cryptic-bastion-24389.
remote: 
To https://git.heroku.com/cryptic-bastion-24389.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/cryptic-bastion-24389.git'

注意到这条消息:

remote: -----> Installing node-v6.10.0-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:  !     NoMethodError: undefined method `load_defaults' for #<Rails::Application::Configuration:0x007fe95df68030>

我在我的文件中查找了代码以查看&#34; load_defaults&#34;正在调用,它似乎来自我的应用程序目录中的application.rb文件&gt;配置

require_relative 'boot'

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module HelloApp
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 5.1

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.
  end
end

但是我尝试查找相同的错误消息并执行所有建议的消息,但我仍然无法将我的应用推送到Heroku,总是再次得到完全相同的错误。我还不确定是什么 &#34; remote:sh:2:语法错误:未终止的引用字符串&#34;甚至意味着。

我认为整个问题与我的宝石有关,所以这里是我的Gemfile文件的内容:

source 'https://rubygems.org'

gem 'rails',        '5.0.1'
gem 'puma',         '3.4.0'
gem 'sass-rails',   '5.0.6'
gem 'uglifier',     '3.0.0'
gem 'coffee-rails', '4.2.1'
gem 'jquery-rails', '4.1.1'
gem 'turbolinks',   '5.0.1'
gem 'jbuilder',     '2.4.1'

group :development, :test do
  gem 'sqlite3', '1.3.12'
  gem 'byebug',  '9.0.0', platform: :mri
end

group :development do
  gem 'web-console',           '3.1.1'
  gem 'listen',                '3.0.8'
  gem 'spring',                '1.7.2'
  gem 'spring-watcher-listen', '2.0.0'
end

group :production do
  gem 'pg', '0.18.4'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

是的我已经执行了捆绑安装 - 没有任何生产。从一开始就没有运气。 AFAIK我遵循了铁路教程书第一章中的所有步骤。

输出&#34; bundle exec install&#34;

install: missing file operand 

和&#34;捆绑exec安装?&#34;,

sh: 1: install?: not found

4 个答案:

答案 0 :(得分:16)

转到config/application.rb,然后将此代码config.load_defaults 5.1评论为:#config.load_defaults 5.1(插入&#34;#&#34;) 或者您可以删除此代码,但如果您以后可能需要此代码,那么最好将其注释掉。

我有同样的问题,评论出来并且工作正常。

答案 1 :(得分:5)

好吧,首先,我要为自己提出问题并在20分钟后自己找到解决方案而道歉。

虽然我不确定什么出现故障,但我确实将其缩小到Rails和其他宝石的不同版本,因为我使用的是旧版特定版本的书,railstutorial.org /书,指示我使用。

我所做的是使用命令 rails new 为我的Gemfile提供的所有默认gem,而不指定版本或pg gem的生产组以外的任何其他内容。

修复它的Gemfile代码:

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end


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

# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :production do
  gem 'pg'
end


group :development, :test do
  # Use sqlite3 as the database for Active Record
  gem 'sqlite3'
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.13.0'
  gem 'selenium-webdriver'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

答案 2 :(得分:1)

它正在尝试使用/usr/lib gems文件夹。 您可以使用它查看gems文件夹:

bundle show --paths

当我在项目文件夹的./vendor/bundle上安装了所有Gems时,它运行正常。

bundle install --path vendor/bundle

答案 3 :(得分:0)

您已经安装了Rails 5.0.1。 load_defaults直到5.1.7才引入。

https://apidock.com/rails/v5.1.7/Rails/Application/Configuration/load_defaults