2016-05-24 15 views
1

これはこのトピックの最初の投稿ですので、優しくしてください。しかし、私のアプリケーションrakefileを実行するときにKeyerrorが発生しています。何か案は?Ruby App on Heroku:レーキが中止されました。 KeyError:キーが見つかりません

MacBook-Pro:proleaderboard aidenhowes$ git push heroku master 
Counting objects: 757, done. 
Delta compression using up to 8 threads. 
Compressing objects: 100% (293/293), done. 
Writing objects: 100% (757/757), 334.41 KiB | 0 bytes/s, done. 
Total 757 (delta 419), reused 739 (delta 409) 
remote: Compressing source files... done. 
remote: Building source: 
remote: 
remote: -----> Ruby app detected 
remote: -----> Compiling Ruby/Rails 
remote: -----> Using Ruby version: ruby-2.2.4 
remote: -----> Installing dependencies using bundler 1.11.2 
remote:  Running: bundle install --without development:test --path      vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment 
remote:  Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. 
remote:  Fetching source index from https://rubygems.org/ 
remote:  Fetching source index from https://rails-assets.org/ 
remote:  Fetching git://github.com/thoughtbot/paperclip.git 
remote:  Fetching gem metadata from https://rails-assets.org/... 
remote:  Fetching version metadata from https://rails-assets.org/.. 
remote:  Fetching git://github.com/mislav/will_paginate.git 
remote:  Fetching git://github.com/bootstrap-ruby/will_paginate- bootstrap.git 
remote:  Installing rake 11.1.2 
remote:  Installing concurrent-ruby 1.0.2 
remote:  Installing i18n 0.7.0 
remote:  Installing minitest 5.8.4 
remote:  Installing thread_safe 0.3.5 
remote:  Installing builder 3.2.2 
remote:  Installing erubis 2.7.0 
remote:  Installing mini_portile2 2.0.0 
remote:  Installing json 1.8.3 with native extensions 
remote:  Installing nio4r 1.2.1 with native extensions 
remote:  Installing websocket-extensions 0.1.2 
remote:  Installing mime-types-data 3.2016.0221 
remote:  Installing arel 7.0.0 
remote:  Installing execjs 2.6.0 
remote:  Installing json_pure 1.8.3 
remote:  Installing bcrypt 3.1.11 with native extensions 
remote:  Installing sass 3.4.22 
remote:  Installing callsite 0.0.11 
remote:  Installing chartkick 1.5.2 
remote:  Installing coffee-script-source 1.10.0 
remote:  Installing method_source 0.8.2 
remote:  Installing thor 0.19.1 
remote:  Installing orm_adapter 0.5.0 
remote:  Installing multi_xml 0.5.5 
remote:  Installing multi_json 1.12.0 
remote:  Installing turbolinks-source 5.0.0.beta4 
remote:  Installing mimemagic 0.3.1 
remote:  Using bundler 1.11.2 
remote:  Installing puma 3.4.0 with native extensions 
remote:  Installing rails-assets-tether 1.3.2 
remote:  Installing pg 0.18.4 with native extensions 
remote:  Installing rails_serve_static_assets 0.0.5 
remote:  Installing rails_stdout_logging 0.0.5 
remote:  Using will_paginate 3.1.0 from git://github.com/mislav/will_paginate.git (at [email protected]) 
remote:  Installing tilt 2.0.2 
remote:  Installing yard 0.8.7.6 
remote:  Installing faker 1.6.3 
remote:  Installing tzinfo 1.2.2 
remote:  Installing nokogiri 1.6.7.2 with native extensions 
remote:  Installing websocket-driver 0.6.3 with native extensions 
remote:  Installing mime-types 3.0 
remote:  Installing autoprefixer-rails 6.3.6 
remote:  Installing uglifier 3.0.0 
remote:  Installing jmespath 1.2.4 
remote:  Installing coffee-script 2.4.1 
remote:  Installing rack 2.0.0.rc1 
remote:  Installing httparty 0.13.7 
remote:  Installing turbolinks 5.0.0.beta2 
remote:  Installing rails_12factor 0.0.3 
remote:  Installing activesupport 5.0.0.rc1 
remote:  Using will_paginate-bootstrap 1.0.1 from git://github.com/bootstrap-ruby/will_paginate-bootstrap.git (at [email protected]) 
remote:  Installing bootstrap 4.0.0.alpha3 
remote:  Installing mail 2.6.4 
remote:  Installing aws-sdk-core 2.3.4 
remote:  Installing warden 1.2.6 
remote:  Installing rack-test 0.6.3 
remote:  Installing rack-contrib 1.2.0 
remote:  Installing rails-deprecated_sanitizer 1.0.3 
remote:  Installing sprockets 3.6.0 
remote:  Installing globalid 0.3.6 
remote:  Installing activemodel 5.0.0.rc1 
remote:  Installing climate_control 0.0.3 
remote:  Installing groupdate 2.5.3 
remote:  Installing jbuilder 2.4.1 
remote:  Installing loofah 2.0.3 
remote:  Installing aws-sdk-resources 2.3.4 
remote:  Installing rails-dom-testing 1.0.7 
remote:  Installing activejob 5.0.0.rc1 
remote:  Installing activerecord 5.0.0.rc1 
remote:  Installing cocaine 0.5.8 
remote:  Using paperclip 5.0.0.beta2 from git://github.com/thoughtbot/paperclip.git (at [email protected]) 
remote:  Installing rails-html-sanitizer 1.0.3 
remote:  Installing aws-sdk 2.3.4 
remote:  Installing actionview 5.0.0.rc1 
remote:  Installing actionpack 5.0.0.rc1 
remote:  Installing actionmailer 5.0.0.rc1 
remote:  Installing actioncable 5.0.0.rc1 
remote:  Installing railties 5.0.0.rc1 
remote:  Installing sprockets-rails 3.0.4 
remote:  Installing responders 2.2.0 
remote:  Installing coffee-rails 4.1.1 
remote:  Installing font-awesome-rails 4.6.2.0 
remote:  Installing jquery-turbolinks 2.1.0 
remote:  Installing jquery-rails 4.1.1 
remote:  Installing meta_request 0.4.0 
remote:  Installing jquery-ui-rails 5.0.5 
remote:  Installing rails 5.0.0.rc1 
remote:  Installing sass-rails 5.0.4 
remote:  Installing devise 4.0.2 
remote:  Bundle complete! 38 Gemfile dependencies, 89 gems now installed. 
remote:  Gems in the groups development and test were not installed. 
remote:  Bundled gems are installed into ./vendor/bundle. 
remote:  Post-install message from httparty: 
remote:  When you HTTParty, you must party hard! 
remote:  Post-install message from paperclip: 
remote:  ################################################## 
remote:  # NOTE FOR UPGRADING FROM 4.3.0 OR EARLIER  # 
remote:  ################################################## 
remote:  Paperclip is now compatible with aws-sdk >= 2.0.0. 
remote:  If you are using S3 storage, aws-sdk >= 2.0.0 requires you to make a few small 
remote:  changes: 
remote:  * You must set the `s3_region` 
remote:  * If you are explicitly setting permissions anywhere, such as in an initializer, 
remote:  note that the format of the permissions changed from using an underscore to 
remote:  using a hyphen. For example, `:public_read` needs to be changed to 
remote:  `public-read`. 
remote:  For a walkthrough of upgrading from 4 to 5 and aws-sdk >= 2.0 you can watch 
remote:  http://rubythursday.com/episodes/ruby-snack-27-upgrade-paperclip-and-aws-sdk-in-prep-for-rails-5 
remote:  Bundle completed (54.79s) 
remote:  Cleaning up the bundler cache. 
remote: -----> Preparing app for Rails asset pipeline 
remote:  Running: rake assets:precompile 
remote:  rake aborted! 
remote:  KeyError: key not found: "S3_BUCKET_NAME" 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/config/environments/production.rb:92:in `fetch' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/config/environments/production.rb:92:in `block in <top (required)>' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/railtie.rb:209:in `instance_eval' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/railtie.rb:209:in `configure' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/config/environments/production.rb:1:in `<top (required)>' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.rc1/lib/active_support/dependencies.rb:293:in `require' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.rc1/lib/active_support/dependencies.rb:293:in `block in require' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.rc1/lib/active_support/dependencies.rb:259:in `load_dependency' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.rc1/lib/active_support/dependencies.rb:293:in `require' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/engine.rb:600:in `block (2 levels) in <class:Engine>' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/engine.rb:599:in `each' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/engine.rb:599:in `block in <class:Engine>' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/initializable.rb:30:in `instance_exec' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/initializable.rb:30:in `run' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/initializable.rb:55:in `block in run_initializers' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/initializable.rb:44:in `each' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/initializable.rb:44:in `tsort_each_child' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/initializable.rb:54:in `run_initializers' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/application.rb:352:in `initialize!' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/config/environment.rb:5:in `<top (required)>' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.rc1/lib/active_support/dependencies.rb:293:in `require' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.rc1/lib/active_support/dependencies.rb:293:in `block in require' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.rc1/lib/active_support/dependencies.rb:259:in `load_dependency' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.rc1/lib/active_support/dependencies.rb:293:in `require' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/application.rb:328:in `require_environment!' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.rc1/lib/rails/application.rb:448:in `block in run_tasks_blocks' 
remote:  /tmp/build_ede61efdc5705c0b3b467412e52dba8a/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.0.4/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define' 
remote:  Tasks: TOP => environment 
remote:  (See full trace by running task with --trace) 
remote: ! 
remote: !  Precompiling assets failed. 
remote: ! 
remote: 
remote: !  Push rejected, failed to compile Ruby app 
remote: 
remote: Verifying deploy.... 
remote: 
remote: ! Push rejected to proleaderboard. 
remote: 
To https://git.heroku.com/proleaderboard.git 
! [remote rejected] master -> master (pre-receive hook declined) 
+1

ようこそStackoverflowへようこそあなたの質問について具体的に。多数のエラーログを投稿することは避けてください。少し研究し、問題を説明するログを投稿してより速い応答を得る。 –

+0

S3バケットの設定に問題があるようです( 'KeyError:key not found:" S3_BUCKET_NAME "')。あなたのawsアカウントからあなたのバケツの名前を取得し、それを設定中に含めましたか? – gonzalo2000

+0

これはproduction.rbファイルのS3への参照です。詳細がハードコーディングされるべき場所ですか? '#Amazon Webサービス config.paperclip_defaults = { ストレージ:S3、 s3_credentials:{ バケツ:ENV.fetch( 'S3バケット-NAME')、 access_key_id:ENV.fetch(「AWS-ACCESSsecret_access_key:ENV.fetch( 'AWS-SECRET-ACCESS-/KEY')、 s3_region:ENV.fetch( 'AWS-REGION')、 ' – Aiden

答えて

1

ヘロクで環境変数S3_BUCKET_NAMEを設定する必要があります。 CUIで

することができますあなたはHerokuのアプリのSettings]タブに移動し、Reveal Config Varsと何が必要変数保存することができますGUIでheroku config:set S3_BUCKET_NAME=name_of_bucket

CUIで変数を設定することをお勧めします。なぜなら、何らかの変数が何らかの形でロードされていないという問題があり、CUIで変数を再設定する問題が解決されたからです。

+0

Heroku Dashboard - > Settings GUIを使用して設定値を既に設定していたとしても、FB_API_KEYに対してこの問題が発生しました。コマンドラインから値をプッシュすると、次の 'git push heroku master'は問題なくプリコンパイルできました。ありがとうございました! –

関連する問題