前提・実現したいこと
発生している問題・エラーメッセージ
remote: /tmp/build_a3a16def7065882f09d5d2c7acbca92c/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>' remote: Tasks: TOP => environment remote: (See full trace by running task with --trace) remote: remote: ! remote: ! Precompiling assets failed. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to sampleffy. remote: To https://git.heroku.com/sampleffy.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/sampleffy.git' ### 試したこと 何度も試してもダメでした。 herokuにcreateしたファイルを削除して作り直してもダメでした。 一通りググって試した結果全部ダメでした。 どなたかアドバイスお願いします。 出てきたコード(所々カットしています) ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. Detected buildpacks: Ruby,Node.js See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order -----> Ruby app detected -----> Compiling Ruby/Rails -----> Using Ruby version: ruby-2.5.1 -----> Installing dependencies using bundler 1.15.2 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.4). We suggest you upgrade to the latest version of Bundler by running `gem install Bundle complete! 20 Gemfile dependencies, 66 gems now installed. Gems in the groups development and test were not installed. Bundled gems are installed into ./vendor/bundle. Post-install message from i18n: HEADS UP! i18n 1.1 changed fallbacks to exclude default locale. But that may break your application. Please check your Rails app for 'config.i18n.fallbacks = true'. If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be 'config.i18n.fallbacks = [I18n.default_locale]'. If not, fallbacks will be broken in your app by I18n 1.1.x. For more info see: https://github.com/svenfuchs/i18n/releases/tag/v1.1.0 Post-install message from sass: Ruby Sass is deprecated and will be unmaintained as of 26 March 2019. * If you use Sass as a command-line tool, we recommend using Dart Sass, the new primary implementation: https://sass-lang.com/install * If you use Sass as a plug-in for a Ruby web framework, we recommend using the sassc gem: https://github.com/sass/sassc-ruby#readme * For more details, please refer to the Sass blog: http://sass.logdown.com/posts/7081811 Bundle completed (50.18s) Cleaning up the bundler cache. Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.4). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. The latest bundler is 2.0.1, but you are currently running 1.15.2. To update, run `gem install bundler` -----> Installing node-v10.14.1-linux-x64 -----> Detecting rake tasks -----> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! YAML syntax error occurred while parsing /tmp/build_37e0980603a231b872956b03ecee0a9f/config/database.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Error: (<unknown>): did not find expected key while parsing a block mapping at line 7 column 1 /tmp/build_37e0980603a231b872956b03ecee0a9f/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application/configuration.rb:190:in `rescue in database_configuration' /tmp/build_37e0980603a231b872956b03ecee0a9f/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application/configuration.rb:165:in `database_configuration' /tmp/build_37e0980603a231b872956b03ecee0a9f/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/railtie.rb:133:in `block (2 levels) in <class:Railtie>' /tmp/build_37e0980603a231b872956b03ecee0a9f/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval' /tmp/build_37e0980603a231b872956b03ecee0a9f/vendor/bundle/ruby/2.5.0/gems/activesupport- /tmp/build_37e0980603a231b872956b03ecee0a9f/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define' /tmp/build_37e0980603a231b872956b03ecee0a9f/vendor/bundle/ruby/2.5.0/gems/rake- 12.3.2/exe/rake:27:in `<top (required)>' Tasks: TOP => environment (See full trace by running task with --trace) ! ! Precompiling assets failed. ! ! Push rejected, failed to compile Ruby app. ! Push failed
ローカルでは正常に動きましたか?
Precompiling assets failed.
は結果なので、躓いたところではないです。
上のほうにさかのぼっていったら、別の個所でエラーが出ているはずなので、そこの追記をお願いします。
エラー箇所は一か所ではない可能性があるので、pushコマンドたたいてからをぜんぶさかのぼって探してみてください
ローカルでは動きます。
見た感じこの2つです。
Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.4). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
-----> Installing node-v10.14.1-linux-x64
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
YAML syntax error occurred while parsing /tmp/build_37e0980603a231b872956b03ecee0a9f/config/database.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Error: (<unknown>): did not find expected key while parsing a block mapping at line 7 column 1
/tmp/build_37e0980603a231b872956b03ecee0a9f/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application/configuration.rb:190:in `rescue in database_configuration'
/tmp/build_37e0980603a231b872956b03ecee0a9f/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application/configuration.rb:165:in `database_configuration'
/tmp/build_37e0980603a231b872956b03ecee0a9f/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/railtie.rb:133:in `block (2 levels) in <class:Railtie>'
どうすれば良いのでしょうか...
"Tabs are not allowed." と書いてあります。database.yml でしょうか。
database.yml はこの様になっています。
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
production:
<<: *default
adapter: postgresql
encoding: unicode
pool: 5
回答2件
あなたの回答
tips
プレビュー