为什么我现在得到一个ActionView :: Template :: Error(缺少必需:bucket选项)错误,就在几天前我还没有?

时间:2015-12-04 21:48:04

标签: ruby-on-rails heroku paperclip aws-sdk

基本上,我只是为了真正理解Rails概念而再次构建这个项目,而且几天前我做了完全相同的事情,我可以部署到Heroku,但是现在,我收到了这个错误。

Gemfile:#这是我之前用于将图像上传到Heroku的aws-sdk版本。当我收到此错误时,我尝试使用rubygems.org的最新版本,但这也没有用!我确信我正确地遵循了https://devcenter.heroku.com/articles/paperclip-s3的指南。唯一的区别是我的rails gem现在更新到4.1.14,之后我能够在Heroku中成功部署,它降低了4.1.x。这有什么不同吗?

source 'https://rubygems.org'
ruby '2.1.5'


gem 'rails', '4.1.14'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'paperclip', '~> 4.3', '>= 4.3.2'
gem 'aws-sdk', '< 2.0'

group :development, :test do
    gem 'sqlite3'
end

group :production do
    gem 'pg'
    gem 'rails_12factor'
end

group :doc do
    gem 'sdoc', '~> 0.4.0'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin]

/production.rb

config.paperclip_defaults = {
    :storage => :s3,
    :s3_credentials => {
      :bucket => ENV['S3_BUCKET_NAME'],
      :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
      :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
    }
  }

当我运行heroku配置以确认我成功设置了密钥ID:

=== pinterest-like Config Vars
AWS_ACCESS_KEY_ID\:     AKIAJPROWONA5LBWMQSA
AWS_SECRET_ACCESS_KEY\: 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
DATABASE_URL:           postgres://krptgeulcnbejf:zhQiIF9T27wJhmxUNjNRIjlHTj@ec2
-54-204-40-209.compute-1.amazonaws.com:5432/d8tcb8mnkc4vd7
LANG:                   en_US.UTF-8
RACK_ENV:               production
RAILS_ENV:              production
S3_BUCKET_NAME\:        pinterest-like
SECRET_KEY_BASE:        6c35e8cda335802c55d2506a559bdd7d9d2dd0a20935901deba49985
ed2edfe0bee8a7be822b83a61004a46937fd5f8d956bd017b10993901cce337e0b8fc403

这是我得到的错误日志:

Your version of git is 1.9.4.. Which has serious security vulnerabilities.
More information here: https://blog.heroku.com/archives/2014/12/23/update_your_g
it_clients_on_windows_and_os_x
←[36m2015-12-05T04:27:43.466026+00:00 app[web.1]:←[0m   Rendered pins/index.html
.erb within layouts/application (163.2ms)
←[36m2015-12-05T04:27:43.468383+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:27:43.468385+00:00 app[web.1]:←[0m ActionView::Template::Erro
r (missing required :bucket option):
←[36m2015-12-05T04:27:43.468387+00:00 app[web.1]:←[0m     1: <%= link_to "New Pi
n", new_pin_path %>
←[36m2015-12-05T04:27:43.468387+00:00 app[web.1]:←[0m     2: <% @pins.each do |p
in| %>
←[36m2015-12-05T04:27:43.468388+00:00 app[web.1]:←[0m     3:    <%= link_to imag
e_tag(pin.image.url(:medium)), pin_path(pin) %>
←[36m2015-12-05T04:27:43.468389+00:00 app[web.1]:←[0m     4:    <h3><%= pin.titl
e %></h3>
←[36m2015-12-05T04:27:43.468389+00:00 app[web.1]:←[0m     5:    <p><%= pin.descr
iption %></p>
←[36m2015-12-05T04:27:43.468390+00:00 app[web.1]:←[0m     6:    <%= link_to "Edi
t", edit_pin_path(pin) %>
←[36m2015-12-05T04:27:43.468391+00:00 app[web.1]:←[0m   app/views/pins/index.htm
l.erb:3:in `block in _app_views_pins_index_html_erb__2628207801292301261_7019841
7761740'
←[36m2015-12-05T04:27:43.468392+00:00 app[web.1]:←[0m   app/views/pins/index.htm
l.erb:2:in `_app_views_pins_index_html_erb__2628207801292301261_70198417761740'
←[36m2015-12-05T04:27:43.468393+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:27:43.468393+00:00 app[web.1]:←[0m
←[33m2015-12-05T04:27:43.992797+00:00 heroku[router]:←[0m at=info method=GET pat
h="/favicon.ico" host=pinterest-like.herokuapp.com request_id=db7bb3c8-9f0e-44f5
-bdec-cb19a09a014b fwd="122.52.80.187" dyno=web.1 connect=1ms service=4ms status
=200 bytes=228
←[33m2015-12-05T04:28:12.959655+00:00 heroku[router]:←[0m at=info method=GET pat
h="/" host=pinterest-like.herokuapp.com request_id=a63cda39-b623-432f-a49a-a81d1
631e62d fwd="122.52.80.187" dyno=web.1 connect=0ms service=16ms status=500 bytes
=1754
←[36m2015-12-05T04:28:12.925599+00:00 app[web.1]:←[0m Started GET "/" for 122.52
.80.187 at 2015-12-05 04:28:12 +0000
←[36m2015-12-05T04:28:12.933077+00:00 app[web.1]:←[0m   Rendered pins/index.html
.erb within layouts/application (2.9ms)
←[36m2015-12-05T04:28:12.935206+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:28:12.933228+00:00 app[web.1]:←[0m Completed 500 Internal Ser
ver Error in 4ms (ActiveRecord: 0.7ms)
←[36m2015-12-05T04:28:12.935208+00:00 app[web.1]:←[0m ActionView::Template::Erro
r (missing required :bucket option):
←[36m2015-12-05T04:28:12.935209+00:00 app[web.1]:←[0m     1: <%= link_to "New Pi
n", new_pin_path %>
←[36m2015-12-05T04:28:12.935210+00:00 app[web.1]:←[0m     2: <% @pins.each do |p
in| %>
←[36m2015-12-05T04:28:12.935211+00:00 app[web.1]:←[0m     3:    <%= link_to imag
e_tag(pin.image.url(:medium)), pin_path(pin) %>
←[36m2015-12-05T04:28:12.935212+00:00 app[web.1]:←[0m     4:    <h3><%= pin.titl
e %></h3>
←[36m2015-12-05T04:28:12.935213+00:00 app[web.1]:←[0m     5:    <p><%= pin.descr
iption %></p>
←[36m2015-12-05T04:28:12.935216+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:28:12.935215+00:00 app[web.1]:←[0m   app/views/pins/index.htm
l.erb:2:in `_app_views_pins_index_html_erb__2628207801292301261_70198417761740'
←[36m2015-12-05T04:28:12.935216+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:28:12.935213+00:00 app[web.1]:←[0m     6:    <%= link_to "Edi
t", edit_pin_path(pin) %>
←[36m2015-12-05T04:28:12.935214+00:00 app[web.1]:←[0m   app/views/pins/index.htm
l.erb:3:in `block in _app_views_pins_index_html_erb__2628207801292301261_7019841
7761740'
←[36m2015-12-05T04:28:12.928765+00:00 app[web.1]:←[0m Processing by PinsControll
er#index as HTML
←[33m2015-12-05T04:28:13.395012+00:00 heroku[router]:←[0m at=info method=GET pat
h="/favicon.ico" host=pinterest-like.herokuapp.com request_id=7b22e2c2-10c6-4c78
-9a5d-0a5d6d564121 fwd="122.52.80.187" dyno=web.1 connect=2ms service=3ms status
=200 bytes=228
←[32m2015-12-05T04:28:39.780840+00:00 heroku[api]:←[0m Starting process with com
mand `bundle exec rake db:migrate` by becomingjeramae2.0@gmail.com
←[35m2015-12-05T04:28:43.417590+00:00 heroku[run.9416]:←[0m Awaiting client
←[35m2015-12-05T04:28:43.476731+00:00 heroku[run.9416]:←[0m Starting process wit
h command `bundle exec rake db:migrate`
←[35m2015-12-05T04:28:43.730199+00:00 heroku[run.9416]:←[0m State changed from s
tarting to up
←[35m2015-12-05T04:28:49.005624+00:00 heroku[run.9416]:←[0m Process exited with
status 0
←[35m2015-12-05T04:28:49.023728+00:00 heroku[run.9416]:←[0m State changed from u
p to complete
←[36m2015-12-05T04:28:56.506605+00:00 heroku[web.1]:←[0m State changed from up t
o starting
←[36m2015-12-05T04:28:59.060817+00:00 heroku[web.1]:←[0m Starting process with c
ommand `bin/rails server -p 38816 -e production`
←[36m2015-12-05T04:29:01.625524+00:00 heroku[web.1]:←[0m Stopping all processes
with SIGTERM
←[36m2015-12-05T04:29:04.323815+00:00 heroku[web.1]:←[0m Process exited with sta
tus 143
←[36m2015-12-05T04:29:04.917365+00:00 heroku[web.1]:←[0m State changed from star
ting to up
←[36m2015-12-05T04:29:06.500795+00:00 app[web.1]:←[0m => Booting WEBrick
←[36m2015-12-05T04:29:06.500799+00:00 app[web.1]:←[0m => Rails 4.1.14 applicatio
n starting in production on http://0.0.0.0:38816
←[36m2015-12-05T04:29:06.500801+00:00 app[web.1]:←[0m => Run `rails server -h` f
or more startup options
←[36m2015-12-05T04:29:06.500802+00:00 app[web.1]:←[0m => Notice: server is liste
ning on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
←[36m2015-12-05T04:29:06.500803+00:00 app[web.1]:←[0m => Ctrl-C to shutdown serv
er
←[36m2015-12-05T04:29:06.500803+00:00 app[web.1]:←[0m Started GET "/" for 122.52
.80.187 at 2015-12-05 04:29:06 +0000
←[36m2015-12-05T04:29:06.592729+00:00 app[web.1]:←[0m Processing by PinsControll
er#index as HTML
←[33m2015-12-05T04:29:06.667230+00:00 heroku[router]:←[0m at=info method=GET pat
h="/" host=pinterest-like.herokuapp.com request_id=aa59fd8a-979d-4919-8207-7834a
10c4dbe fwd="122.52.80.187" dyno=web.1 connect=0ms service=163ms status=500 byte
s=1754
←[36m2015-12-05T04:29:06.640742+00:00 app[web.1]:←[0m   Rendered pins/index.html
.erb within layouts/application (27.0ms)
←[36m2015-12-05T04:29:06.646181+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:29:06.640811+00:00 app[web.1]:←[0m Completed 500 Internal Ser
ver Error in 49ms (ActiveRecord: 10.9ms)
←[36m2015-12-05T04:29:06.646182+00:00 app[web.1]:←[0m ActionView::Template::Erro
r (missing required :bucket option):
←[36m2015-12-05T04:29:06.646183+00:00 app[web.1]:←[0m     1: <%= link_to "New Pi
n", new_pin_path %>
←[36m2015-12-05T04:29:06.646184+00:00 app[web.1]:←[0m     2: <% @pins.each do |p
in| %>
←[36m2015-12-05T04:29:06.646184+00:00 app[web.1]:←[0m     3:    <%= link_to imag
e_tag(pin.image.url(:medium)), pin_path(pin) %>
←[36m2015-12-05T04:29:06.646185+00:00 app[web.1]:←[0m     4:    <h3><%= pin.titl
e %></h3>
←[36m2015-12-05T04:29:06.646185+00:00 app[web.1]:←[0m     5:    <p><%= pin.descr
iption %></p>
←[36m2015-12-05T04:29:06.646186+00:00 app[web.1]:←[0m     6:    <%= link_to "Edi
t", edit_pin_path(pin) %>
←[36m2015-12-05T04:29:06.646186+00:00 app[web.1]:←[0m   app/views/pins/index.htm
l.erb:3:in `block in _app_views_pins_index_html_erb__3591826136823766751_6988492
5311020'
←[36m2015-12-05T04:29:06.646187+00:00 app[web.1]:←[0m   app/views/pins/index.htm
l.erb:2:in `_app_views_pins_index_html_erb__3591826136823766751_69884925311020'
←[36m2015-12-05T04:29:06.646188+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:29:06.646188+00:00 app[web.1]:←[0m
←[33m2015-12-05T04:29:07.133101+00:00 heroku[router]:←[0m at=info method=GET pat
h="/favicon.ico" host=pinterest-like.herokuapp.com request_id=050f6686-2e3a-4db7
-a95d-5c6690072f29 fwd="122.52.80.187" dyno=web.1 connect=1ms service=5ms status
=304 bytes=133
←[36m2015-12-05T04:31:35.629074+00:00 app[web.1]:←[0m Started GET "/" for 122.52
.80.187 at 2015-12-05 04:31:35 +0000
←[36m2015-12-05T04:31:35.701663+00:00 app[web.1]:←[0m   Rendered pins/index.html
.erb within layouts/application (43.6ms)
←[36m2015-12-05T04:31:35.823622+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:31:35.823625+00:00 app[web.1]:←[0m ActionView::Template::Erro
r (missing required :bucket option):
←[36m2015-12-05T04:31:35.823627+00:00 app[web.1]:←[0m     1: <%= link_to "New Pi
n", new_pin_path %>
←[36m2015-12-05T04:31:35.823627+00:00 app[web.1]:←[0m     2: <% @pins.each do |p
in| %>
←[36m2015-12-05T04:31:35.823628+00:00 app[web.1]:←[0m     3:    <%= link_to imag
e_tag(pin.image.url(:medium)), pin_path(pin) %>
←[36m2015-12-05T04:31:35.823630+00:00 app[web.1]:←[0m     5:    <p><%= pin.descr
iption %></p>
←[36m2015-12-05T04:31:35.823629+00:00 app[web.1]:←[0m     4:    <h3><%= pin.titl
e %></h3>
←[36m2015-12-05T04:31:35.823630+00:00 app[web.1]:←[0m     6:    <%= link_to "Edi
t", edit_pin_path(pin) %>
←[36m2015-12-05T04:31:35.823632+00:00 app[web.1]:←[0m   app/views/pins/index.htm
l.erb:3:in `block in _app_views_pins_index_html_erb__3591826136823766751_6988492
5311020'
←[36m2015-12-05T04:31:35.823634+00:00 app[web.1]:←[0m   app/views/pins/index.htm
l.erb:2:in `_app_views_pins_index_html_erb__3591826136823766751_69884925311020'
←[36m2015-12-05T04:31:35.823635+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:31:35.823635+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:31:35.656777+00:00 app[web.1]:←[0m Processing by PinsControll
er#index as HTML
←[36m2015-12-05T04:31:35.718724+00:00 app[web.1]:←[0m Completed 500 Internal Ser
ver Error in 62ms (ActiveRecord: 4.6ms)
←[33m2015-12-05T04:31:35.827675+00:00 heroku[router]:←[0m at=info method=GET pat
h="/" host=pinterest-like.herokuapp.com request_id=7461e285-c430-432b-a148-ad5d5
35eea46 fwd="122.52.80.187" dyno=web.1 connect=1ms service=207ms status=500 byte
s=1754
←[33m2015-12-05T04:31:36.204121+00:00 heroku[router]:←[0m at=info method=GET pat
h="/favicon.ico" host=pinterest-like.herokuapp.com request_id=5fe35dbd-0d85-4d3c
-bbf4-71f6f715fbf0 fwd="122.52.80.187" dyno=web.1 connect=0ms service=10ms statu
s=200 bytes=228
←[36m2015-12-05T04:32:01.975101+00:00 app[web.1]:←[0m Started GET "/" for 122.52
.80.187 at 2015-12-05 04:32:01 +0000
←[36m2015-12-05T04:32:01.998281+00:00 app[web.1]:←[0m   Rendered pins/index.html
.erb within layouts/application (16.5ms)
←[36m2015-12-05T04:32:02.000660+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:32:02.000662+00:00 app[web.1]:←[0m ActionView::Template::Erro
r (missing required :bucket option):
←[36m2015-12-05T04:32:02.000664+00:00 app[web.1]:←[0m     1: <%= link_to "New Pi
n", new_pin_path %>
←[36m2015-12-05T04:32:02.000665+00:00 app[web.1]:←[0m     2: <% @pins.each do |p
in| %>
←[36m2015-12-05T04:32:02.000666+00:00 app[web.1]:←[0m     3:    <%= link_to imag
e_tag(pin.image.url(:medium)), pin_path(pin) %>
←[36m2015-12-05T04:32:02.000666+00:00 app[web.1]:←[0m     4:    <h3><%= pin.titl
e %></h3>
←[36m2015-12-05T04:32:02.000667+00:00 app[web.1]:←[0m     5:    <p><%= pin.descr
iption %></p>
←[36m2015-12-05T04:32:02.000667+00:00 app[web.1]:←[0m     6:    <%= link_to "Edi
t", edit_pin_path(pin) %>
←[36m2015-12-05T04:32:02.000668+00:00 app[web.1]:←[0m   app/views/pins/index.htm
l.erb:3:in `block in _app_views_pins_index_html_erb__3591826136823766751_6988492
5311020'
←[36m2015-12-05T04:32:02.000669+00:00 app[web.1]:←[0m   app/views/pins/index.htm
l.erb:2:in `_app_views_pins_index_html_erb__3591826136823766751_69884925311020'
←[36m2015-12-05T04:32:02.000671+00:00 app[web.1]:←[0m
←[36m2015-12-05T04:32:02.000670+00:00 app[web.1]:←[0m
←[33m2015-12-05T04:32:01.999409+00:00 heroku[router]:←[0m at=info method=GET pat
h="/" host=pinterest-like.herokuapp.com request_id=ae975ea6-63c1-4e66-bbb1-aaacd
70ec69f fwd="122.52.80.187" dyno=web.1 connect=0ms service=47ms status=500 bytes
=1754
←[36m2015-12-05T04:32:01.980794+00:00 app[web.1]:←[0m Processing by PinsControll
er#index as HTML
←[36m2015-12-05T04:32:01.998495+00:00 app[web.1]:←[0m Completed 500 Internal Ser
ver Error in 18ms (ActiveRecord: 14.6ms)

0 个答案:

没有答案