if Rails.env.production? CarrIErWave.configure do |config| config.fog_credentials = { # Configuration for Amazon S3 :provIDer => 'AWS',:aws_access_key_ID => ENV['access_key'],:aws_secret_access_key => ENV['secret_access_key'],} config.fog_directory = ENV['bucket'] endend
但是当我尝试推送到heroku时,我得到以下错误:我不知道还有什么要做,任何帮助都将非常感激.
JUSTINs-iMac:premIDx justindoshay$git push herokuFetching repository,done.Counting objects: 23,done.Delta compression using up to 4 threads.Compressing objects: 100% (11/11),done.Writing objects: 100% (12/12),1.09 KiB | 0 bytes/s,done.Total 12 (delta 9),reused 0 (delta 0)-----> Removing .DS_Store files-----> Ruby app detected-----> Compiling Ruby/Rails-----> Using Ruby version: ruby-2.1.3-----> Installing dependencIEs using 1.6.3 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment Using rake 10.3.2 Using minitest 5.4.2 Using thread_safe 0.3.4 Using builder 3.2.2 Using erubis 2.7.0 Using mini_portile 0.6.1 Using rack 1.6.0.beta Using i18n 0.7.0.beta1 Using mime-types 2.4.3 Using arel 6.0.0.beta2 Using bcrypt 3.1.7 Using sass 3.4.7 Using Json 1.8.1 Using will_paginate 3.0.7 Using thor 0.19.1 Using cancan 1.6.10 Using uber 0.0.10 Using execJs 2.2.2 Using formatador 0.2.5 Using coffee-script-source 1.8.0 Using excon 0.41.0 Using net-ssh 2.9.1 Using inflecto 0.0.2 Using multi_Json 1.10.1 Using ipaddress 0.8.0 Using gritter 1.1.0 Using hike 1.2.3 Using kgio 2.9.2 Using pg 0.17.1 Using bundler 1.6.3 Using subexec 0.2.3 Using rails_serve_static_assets 0.0.2 Using tilt 1.4.1 Using raindrops 0.13.0 Using rails_stdout_logging 0.0.3 Using tzinfo 1.2.2 Using nokogiri 1.6.4 Using rack-test 0.6.2 Using rdoc 4.1.2 Using mail 2.6.3 Using bootstrap-will_paginate 0.0.10 Using bootstrap-sass 3.2.0.0 Using uglifIEr 2.5.3 Using faker 1.4.2 Using coffee-script 2.3.0 Using net-scp 1.2.1 Using fog-Json 1.0.0 Using mini_magick 3.8.0 Using unicorn 4.8.3 Using activesupport 4.2.0.beta4 Using sprockets 2.12.3 Using rails_12factor 0.0.2 Using sdoc 0.4.0 Using fog-core 1.24.0 Using rails-deprecated_sanitizer 1.0.3 Using globalID 0.3.0 Using loofah 2.0.1 Using jbuilder 2.2.3 Using activemodel 4.2.0.beta4 Using fog-brightBox 0.6.1 Using fog-softlayer 0.3.23 Using rails-dom-testing 1.0.4 Using activejob 4.2.0.beta4 Using rails-HTML-sanitizer 1.0.1 Using activerecord 4.2.0.beta4 Using carrIErwave 0.10.0 Using actionvIEw 4.2.0.beta4 Using fog 1.23.0 Using frIEndly_ID 5.0.4 Using actionpack 4.2.0.beta4 Using actionmailer 4.2.0.beta4 Using sprockets-rails 3.0.0.beta1 Using simple_form 3.0.2 Using railtIEs 4.2.0.beta4 Using coffee-rails 4.0.1 Using cells 3.11.2 Using jquery-rails 4.0.0.beta2 Using rails 4.2.0.beta4 Using sass-rails 5.0.0.beta1 Using turbolinks 2.3.0 Your bundle is complete! Gems in the groups development and test were not installed. It was installed into ./vendor/bundle Bundle completed (0.79s) Cleaning up the bundler cache.-----> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! ArgumentError: Missing required arguments: aws_access_key_ID,aws_secret_access_key /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/fog-core-1.24.0/lib/fog/core/service.rb:237:in `valIDate_options' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/fog-core-1.24.0/lib/fog/core/service.rb:261:in `handle_settings' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/fog-core-1.24.0/lib/fog/core/service.rb:98:in `new' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/fog-core-1.24.0/lib/fog/storage.rb:26:in `new' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/carrIErwave-0.10.0/lib/carrIErwave/uploader/configuration.rb:83:in `eager_load_fog' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/carrIErwave-0.10.0/lib/carrIErwave/uploader/configuration.rb:96:in `fog_credentials=' /tmp/build_147081514681b2a6351adf453926ef97/config/initializers/carrIEr_wave.rb:3:in `block in <top (required)>' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/carrIErwave-0.10.0/lib/carrIErwave/uploader/configuration.rb:118:in `configure' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/carrIErwave-0.10.0/lib/carrIErwave.rb:14:in `configure' /tmp/build_147081514681b2a6351adf453926ef97/config/initializers/carrIEr_wave.rb:2:in `<top (required)>' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/dependencIEs.rb:246:in `load' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/dependencIEs.rb:246:in `block in load' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/dependencIEs.rb:237:in `load_dependency' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/dependencIEs.rb:246:in `load' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/engine.rb:648:in `block in load_config_initializer' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/notifications.rb:166:in `instrument' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/engine.rb:647:in `load_config_initializer' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/engine.rb:611:in `each' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/engine.rb:611:in `block in <class:Engine>' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/initializable.rb:30:in `instance_exec' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/initializable.rb:30:in `run' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/initializable.rb:55:in `block in run_initializers' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/initializable.rb:44:in `each' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/initializable.rb:44:in `tsort_each_child' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/initializable.rb:54:in `run_initializers' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/application.rb:349:in `initialize!' /tmp/build_147081514681b2a6351adf453926ef97/config/environment.rb:5:in `<top (required)>' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/dependencIEs.rb:252:in `require' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/dependencIEs.rb:252:in `block in require' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/dependencIEs.rb:237:in `load_dependency' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/dependencIEs.rb:252:in `require' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/application.rb:325:in `require_environment!' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/railtIEs-4.2.0.beta4/lib/rails/application.rb:438:in `block in run_tasks_blocks' /tmp/build_147081514681b2a6351adf453926ef97/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-3.0.0.beta1/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define' Tasks: top => environment (See full trace by running task with --trace) ! ! Precompiling assets Failed. ! ! Push rejected,Failed to compile Ruby appTo git@heroku.com:damp-coast-2948.git ! [remote rejected] master -> master (pre-receive hook declined)error: Failed to push some refs to 'git@heroku.com:damp-coast-2948.git'解决方法 确保已设置环境变量
你可以通过运行来做到这一点
heroku配置
在你的终端.
如果您没有看到ACCESS_KEY或,则此命令将输出您当前的环境变量
SECRET_ACCESS_KEY然后在终端中运行以下命令
heroku config:set ACCESS_KEY=YOUR_ACCESS_KEY_HEREheroku config:set SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY_HERE总结
以上是内存溢出为你收集整理的ruby-on-rails – Heroku | Ruby ArgumentError:缺少必需的参数:全部内容,希望文章能够帮你解决ruby-on-rails – Heroku | Ruby ArgumentError:缺少必需的参数:所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)