web-dev-qa-db-ja.com

Herokuにアプリをデプロイしようとするとエラー「Undefined method "load_defaults"」が発生する

私はRubyおよびRailsプログラミング)を初めて使用しているので、railstutorial.orgのオンラインブックをフォローしていて、今までにない障害に遭遇しました数時間解決できなかった:

Bashで「git Push heroku master」を実行すると、次の結果が得られます。

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>

「load_defaults」が呼び出されている場所を確認するためにファイル内のコードを検索しました。これは、アプリのディレクトリ> configにあるファイルapplication.rbからのようです

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にプッシュできず、常にまったく同じエラーが再度表示されます。 「リモート:sh:2:構文エラー:引用符で囲まれていない文字列が終了している」がまだどういう意味かはまだわかりません。

問題全体は私の宝石に関連していると思いますので、ここに私の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]

はい、私はバンドルインストールを実行しました。最初から運がない。私の知る限り、私は鉄道図書の最初の章のすべてのステップに従いました。

"bundle exec install"の出力

install: missing file operand 

そして「バンドル実行インストール?」、

sh: 1: install?: not found
12
Gerry Hernandez

さて、最初に、質問をしなければならない限り、20分後に自分でsolutionを見つけたことをお詫びします。

正確にはわかりませんがwhatが誤動作していたので、Railsと他のgemの異なるバージョンに絞り込みました。 book、railstutorial.org/bookは、使用するように指示しました。

私が行ったことは、pg gemのバージョンや本番グループ以外を指定せずに、私のGemfileに対してRails newコマンドで指定されたすべてのデフォルトの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]
5
Gerry Hernandez

config/application.rbに移動し、このコードをコメントconfig.load_defaults 5.1のようにコメントアウトします:#config.load_defaults 5.1(「#」を挿入)またはこのコードを削除できますが、後で必要になる場合があるため、コメントアウトするだけです。

私は同じ問題を抱えていて、コメントアウトして、それはうまくいきました。

16
bishal

OK、バンドルしてみて、結果を報告してください。バンドルが不足していると報告された場合は、gem install bundlerを実行します

1
Tom Connolly

/usr/lib gemsフォルダを使用しようとしています。あなたはそれを使ってgemsフォルダを見ることができます:

bundle show --paths

プロジェクトフォルダの./vendor/bundleにすべてのGemsをインストールしたところ、問題なく動作しました。

bundle install --path vendor/bundle

1
Marylly Silva