一个月的Rails(Pins将在本地上传/创建,但不会在heroku上创建)

时间:2014-01-24 07:25:26

标签: ruby-on-rails heroku ruby-on-rails-4

现在除了我的针脚外,一切都有效,它们是在本地创建的,但不是通过heroku创建的。单击“创建引脚”后选择文件和说明后,它会显示一个错误屏幕

"We're sorry, but something went wrong.

If you are the application owner check the logs for more information"

所以我去检查我的日志,但是我找不到任何关于为什么Pins会在本地创建而不是在heroku上的内容,这里是我的heroku日志:

$ heroku logs
←[36m2014-01-24T07:15:55.176479+00:00 app[web.1]:←[0m Completed 200 OK in 9ms (V
iews: 4.7ms | ActiveRecord: 2.3ms)
←[36m2014-01-24T07:16:03.578229+00:00 app[web.1]:←[0m Started POST "/pins" for 1
08.227.81.48 at 2014-01-24 07:16:03 +0000
←[36m2014-01-24T07:16:03.581709+00:00 app[web.1]:←[0m Processing by PinsControll
er#create as HTML
←[36m2014-01-24T07:16:03.581709+00:00 app[web.1]:←[0m Processing by PinsControll
er#create as HTML
←[36m2014-01-24T07:16:03.591357+00:00 app[web.1]:←[0m Command :: identify -forma
t '%wx%h,%[exif:orientation]' '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:03.591357+00:00 app[web.1]:←[0m Command :: identify -forma
t '%wx%h,%[exif:orientation]' '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:03.581709+00:00 app[web.1]:←[0m   Parameters: {"utf8"=>"??
?", "authenticity_token"=>"S4uSwATtp3QwzQkqR6UqgyQpYiatPzuBwDPCrMC+Y70=", "pin"=
>{"image"=>#<ActionDispatch::Http::UploadedFile:0x007f3148903780 @tempfile=#<Tem
pfile:/tmp/RackMultipart20140124-2-re7qmp>, @original_filename="crazy dog 5.jpg"
, @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"p
in[image]\"; filename=\"crazy dog 5.jpg\"\r\nContent-Type: image/jpeg\r\n">, "de
scription"=>""}, "commit"=>"Create Pin"}
←[36m2014-01-24T07:16:03.578229+00:00 app[web.1]:←[0m Started POST "/pins" for 1
08.227.81.48 at 2014-01-24 07:16:03 +0000
←[36m2014-01-24T07:16:03.581709+00:00 app[web.1]:←[0m   Parameters: {"utf8"=>"??
?", "authenticity_token"=>"S4uSwATtp3QwzQkqR6UqgyQpYiatPzuBwDPCrMC+Y70=", "pin"=
>{"image"=>#<ActionDispatch::Http::UploadedFile:0x007f3148903780 @tempfile=#<Tem
pfile:/tmp/RackMultipart20140124-2-re7qmp>, @original_filename="crazy dog 5.jpg"
, @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"p
in[image]\"; filename=\"crazy dog 5.jpg\"\r\nContent-Type: image/jpeg\r\n">, "de
scription"=>""}, "commit"=>"Create Pin"}
←[36m2014-01-24T07:16:03.649585+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:03.649585+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:03.693658+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:03.693658+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:03.737493+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:03.737493+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:03.781732+00:00 app[web.1]:←[0m Command :: convert '/tmp/c
razy dog 520140124-2-10xddtf.jpg[0]' -auto-orient -resize "300x300>" '/tmp/crazy
 dog 520140124-2-10xddtf20140124-2-loegyh'
←[36m2014-01-24T07:16:03.781801+00:00 app[web.1]:←[0m Command :: convert '/tmp/c
razy dog 520140124-2-10xddtf.jpg[0]' -auto-orient -resize "300x300>" '/tmp/crazy
 dog 520140124-2-10xddtf20140124-2-loegyh'
←[36m2014-01-24T07:16:03.887405+00:00 app[web.1]:←[0m Command :: file -b --mime
'/tmp/crazy dog 520140124-2-10xddtf20140124-2-loegyh'
←[36m2014-01-24T07:16:03.887405+00:00 app[web.1]:←[0m Command :: fi
le -b --mime '/tmp/crazy dog 520140124-2-10xddtf20140124-2-loegyh'
←[36m2014-01-24T07:16:03.931602+00:00 app[web.1]:←[0m Command :: identify -forma
t '%wx%h,%[exif:orientation]' '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:03.931602+00:00 app[web.1]:←[0m Command :: identify -forma
t '%wx%h,%[exif:orientation]' '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:03.989284+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:03.989380+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:04.155010+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:04.104421+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:04.199282+00:00 app[web.1]:←[0m Command :: convert '/tmp/c
razy dog 520140124-2-10xddtf.jpg[0]' -auto-orient -resize "100x100>" '/tmp/crazy
 dog 520140124-2-10xddtf20140124-2-a08c7h'
←[36m2014-01-24T07:16:04.155010+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:04.104421+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-10xddtf.jpg[0]'
←[36m2014-01-24T07:16:04.199282+00:00 app[web.1]:←[0m Command :: convert '/tmp/c
razy dog 520140124-2-10xddtf.jpg[0]' -auto-orient -resize "100x100>" '/tmp/crazy
 dog 520140124-2-10xddtf20140124-2-a08c7h'
←[36m2014-01-24T07:16:04.304820+00:00 app[web.1]:←[0m Command :: file -b --mime
'/tmp/crazy dog 520140124-2-10xddtf20140124-2-a08c7h'
←[36m2014-01-24T07:16:04.304820+00:00 app[web.1]:←[0m Command :: file -b --mime
'/tmp/crazy dog 520140124-2-10xddtf20140124-2-a08c7h'
←[36m2014-01-24T07:16:04.368775+00:00 app[web.1]:←[0m   Rendered pins/_form.html
.erb (8.8ms)
←[36m2014-01-24T07:16:04.369148+00:00 app[web.1]:←[0m   Rendered pins/new.html.e
rb within layouts/application (11.1ms)
←[36m2014-01-24T07:16:04.368775+00:00 app[web.1]:←[0m   Rendered pins/_form.html
.erb (8.8ms)
←[36m2014-01-24T07:16:04.369148+00:00 app[web.1]:←[0m   Rendered pins/new.html.e
rb within layouts/application (11.1ms)
←[36m2014-01-24T07:16:04.371142+00:00 app[web.1]:←[0m   Rendered layouts/_header
.html.erb (1.0ms)
←[36m2014-01-24T07:16:04.371142+00:00 app[web.1]:←[0m   Rendered layouts/_header
.html.erb (1.0ms)
←[36m2014-01-24T07:16:04.371786+00:00 app[web.1]:←[0m Completed 200 OK in 790ms
(Views: 15.3ms | ActiveRecord: 6.7ms)
←[36m2014-01-24T07:16:04.371786+00:00 app[web.1]:←[0m Completed 200 OK in 790ms
(Views: 15.3ms | ActiveRecord: 6.7ms)
←[33m2014-01-24T07:16:04.374707+00:00 heroku[router]:←[0m at=info method=POST pa
th=/pins host=omr-pinterestingx.herokuapp.com request_id=054424a1-704b-460e-a409
-8ad8a28594a4 fwd="108.227.81.48" dyno=web.1 connect=1ms service=1137ms status=2
00 bytes=2808
←[36m2014-01-24T07:16:08.496084+00:00 app[web.1]:←[0m Started POST "/pins" for 1
08.227.81.48 at 2014-01-24 07:16:08 +0000
2014-01-24T07:16:08.498379+00:00 app[we
b.1]: Processing by PinsController#create as HTML
←[36m2014-01-24T07:16:08.498435+00:00 app[web.1]:←[0m   Parameters: {"utf8"=>"??
?", "authenticity_token"=>"S4uSwATtp3QwzQkqR6UqgyQpYiatPzuBwDPCrMC+Y70=", "pin"=
>{"description"=>"sdfdsfa"}, "commit"=>"Create Pin"}
←[36m2014-01-24T07:16:08.498435+00:00 app[web.1]:←[0m   Parameters: {"utf8"=>"??
?", "authenticity_token"=>"S4uSwATtp3QwzQkqR6UqgyQpYiatPzuBwDPCrMC+Y70=", "pin"=
>{"description"=>"sdfdsfa"}, "commit"=>"Create Pin"}
←[36m2014-01-24T07:16:08.496084+00:00 app[web.1]:←[0m Started POST "/pins" for 1
08.227.81.48 at 2014-01-24 07:16:08 +0000
←[36m2014-01-24T07:16:08.498379+00:00 app[web.1]:←[0m Processing by PinsControll
er#create as HTML
←[36m2014-01-24T07:16:08.517459+00:00 app[web.1]:←[0m   Rendered pins/new.html.e
rb within layouts/application (5.1ms)
←[36m2014-01-24T07:16:08.517295+00:00 app[web.1]:←[0m   Rendered pins/_form.html
.erb (4.6ms)
←[36m2014-01-24T07:16:08.517295+00:00 app[web.1]:←[0m   Rendered pins/_form.html
.erb (4.6ms)
←[36m2014-01-24T07:16:08.517459+00:00 app[web.1]:←[0m   Rendered pins/new.html.e
rb within layouts/application (5.1ms)
←[36m2014-01-24T07:16:08.518655+00:00 app[web.1]:←[0m   Rendered layouts/_header
.html.erb (0.6ms)
←[36m2014-01-24T07:16:08.519081+00:00 app[web.1]:←[0m Completed 200 OK in 20ms (
Views: 7.0ms | ActiveRecord: 6.2ms)
←[36m2014-01-24T07:16:08.519081+00:00 app[web.1]:←[0m Completed 200 OK in 20ms (
Views: 7.0ms | ActiveRecord: 6.2ms)
←[33m2014-01-24T07:16:08.523647+00:00 heroku[router]:←[0m at=info method=POST pa
th=/pins host=omr-pinterestingx.herokuapp.com request_id=1584da39-acde-44b8-a8af
-bf3f150a04c5 fwd="108.227.81.48" dyno=web.1 connect=4ms service=32ms status=200
 bytes=2809
←[36m2014-01-24T07:16:08.518655+00:00 app[web.1]:←[0m   Rendered layouts/_header
.html.erb (0.6ms)
←[36m2014-01-24T07:16:15.644860+00:00 app[web.1]:←[0m   Parameters: {"utf8"=>"??
?", "authenticity_token"=>"S4uSwATtp3QwzQkqR6UqgyQpYiatPzuBwDPCrMC+Y70=", "pin"=
>{"image"=>#<ActionDispatch::Http::UploadedFile:0x007f31475320f8 @tempfile=#<Tem
pfile:/tmp/RackMultipart20140124-2-xfokyr>, @original_filename="crazy dog 5.jpg"
, @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"p
in[image]\"; filename=\"crazy dog 5.jpg\"\r\nContent-Type: image/jpeg\r\n">, "de
scription"=>"sdfdsfa"}, "commit"=>"Create Pin"}
←[36m2014-01-24T07:16:15.643356+00:00 app[web.1]:←[0m Started POST "/pins" for 1
08.227.81.48 at 2014-01-24 07:16:15 +0000
←[36m2014-01-24T07:16:15.644733+00:00 app[web.1]:←[0m Processing by PinsControll
er#create as HTML
←[36m2014-01-24T07:16:15.644733+00:00 app[web.1]:←[0m Processing by PinsControll
er#create as HTML
←[36m2014-01-24T07:16:15.653397+00:00 app[web.1]:←[0m Command :: identify -forma
t '%wx%h,%[exif:orientation]' '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:15.653397+00:00 app[web.1]:←[0m Command :: identify -forma
t '%wx%h,%[exif:orientation]' '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:15.643356+00:00 app[web.1]:←[0m Started POST "/pins" for 1
08.227.81.48 at 2014-01-24 07:16:15 +0000
←[36m2014-01-24T07:16:15.644860+00:00 app[web.1]:←[0m   Parameters: {"utf8"=>"??
?", "authenticity_token"=>"S4uSwATtp3QwzQkqR6UqgyQpYiatPzuBwDPCrMC+Y70=", "pin"=
>{"image"=>#<ActionDispatch::Http::UploadedFile:0x007f31475320f8 @tempfile=#<Tem
pfile:/tmp/RackMultipart20140124-2-xfokyr>, @original_filename="crazy dog 5.jpg"
, @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"p
in[image]\"; filename=\"crazy dog 5.jpg\"\r\nContent-Type: image/jpeg\r\n">, "de
scription"=>"sdfdsfa"}, "commit"=>"Create Pin"}
←[36m2014-01-24T07:16:15.705305+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:15.705305+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:15.749979+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:15.749979+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:15.793258+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:15.793258+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:15.838322+00:00 app[web.1]:←[0m Command :: convert '/tmp/c
razy dog 520140124-2-11l83j9.jpg[0]' -auto-orient -resize "300x300>" '/tmp/crazy
 dog 520140124-2-11l83j920140124-2-1i90jef'
←[36m2014-01-24T07:16:15.838322+00:00 app[web.1]:←[0m Command :: convert '/tmp/c
razy dog 520140124-2-11l83j9.jpg[0]' -auto-orient -resize "300x300>" '/tmp/crazy
 dog 520140124-2-11l83j920140124-2-1i90jef'
←[36m2014-01-24T07:16:15.915153+00:00 app[web.1]:←[0m Command :: file -b --mime
'/tmp/crazy dog 520140124-2-11l83j920140124-2-1i90jef'
←[36m2014-01-24T07:16:15.915153+00:00 app[web.1]:←[0m Command :: file -b --mime
'/tmp/crazy dog 520140124-2-11l83j920140124-2-1i90jef'
←[36m2014-01-24T07:16:15.955711+00:00 app[web.1]:←[0m Command :: identify -forma
t '%wx%h,%[exif:orientation]' '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:15.955711+00:00 app[web.1]:←[0m Command :: identify -forma
t '%wx%h,%[exif:orientation]' '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:16.007354+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:16.007354+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:16.053014+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:16.053014+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:16.102588+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:16.102588+00:00 app[web.1]:←[0m Command :: identify -forma
t %m '/tmp/crazy dog 520140124-2-11l83j9.jpg[0]'
←[36m2014-01-24T07:16:16.148076+00:00 app[web.1]:←[0m Command :: convert '/tmp/c
razy dog 520140124-2-11l83j9.jpg[0]' -auto-orient -resize "100x100>" '/tmp/crazy
 dog 520140124-2-11l83j920140124-2-9yugtu'
←[36m2014-01-24T07:16:16.148076+00:00 app[web.1]:←[0m Command :: convert '/tmp/c
razy dog 520140124-2-11l83j9.jpg[0]' -auto-orient -resize "100x100>" '/tmp/crazy
 dog 520140124-2-11l83j920140124-2-9yugtu'
←[36m2014-01-24T07:16:16.209966+00:00 app[web.1]:←[0m Command :: file -b --mime
'/tmp/crazy dog 520140124-2-11l83j920140124-2-9yugtu'
←[36m2014-01-24T07:16:16.209966+00:00 app[web.1]:←[0m Command :: file -b --mime
'/tmp/crazy dog 520140124-2-11l83j920140124-2-9yugtu'
←[36m2014-01-24T07:16:16.257348+00:00 app[web.1]:←[0m [paperclip] saving /pins/i
mages/000/000/005/original/crazy_dog_5.jpg
←[36m2014-01-24T07:16:16.257348+00:00 app[web.1]:←[0m [paperclip] saving /pins/i
mages/000/000/005/original/crazy_dog_5.jpg
←[36m2014-01-24T07:16:16.261485+00:00 app[web.1]:←[0m Completed 500 Internal Ser
ver Error in 616ms
←[36m2014-01-24T07:16:16.263627+00:00 app[web.1]:←[0m ArgumentError (missing req
uired :bucket option):
←[36m2014-01-24T07:16:16.263627+00:00 app[web.1]:←[0m
←[36m2014-01-24T07:16:16.261485+00:00 app[web.1]:←[0m Completed 500 Internal Ser
ver Error in 616ms
←[33m2014-01-24T07:16:16.268735+00:00 heroku[router]:←[0m at=info method=POST pa
th=/pins host=omr-pinterestingx.herokuapp.com request_id=219149e6-2fab-427c-a3fc
-f28a4788c281 fwd="108.227.81.48" dyno=web.1 connect=2ms service=958ms status=50
0 bytes=1266
←[36m2014-01-24T07:16:16.263627+00:00 app[web.1]:←[0m   app/controllers/pins_con
troller.rb:22:in `create'
←[36m2014-01-24T07:16:16.263627+00:00 app[web.1]:←[0m
←[36m2014-01-24T07:16:16.263627+00:00 app[web.1]:←[0m ArgumentError (missing req
uired :bucket option):
←[36m2014-01-24T07:16:16.263627+00:00 app[web.1]:←[0m
←[36m2014-01-24T07:16:16.263627+00:00 app[web.1]:←[0m
←[36m2014-01-24T07:16:16.263627+00:00 app[web.1]:←[0m   app/controllers/pins_con
troller.rb:22:in `create'
←[36m2014-01-24T07:16:16.263627+00:00 app[web.1]:←[0m
←[36m2014-01-24T07:16:16.263627+00:00 app[web.1]:←[0m
←[33m2014-01-24T07:15:30.542171+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=omr-pinterestingx.herokuapp.com request_id=4ab18407-9a1f-40cf-8cd5-9876
6dd76106 fwd="108.227.81.48" dyno=web.1 connect=2ms service=19ms status=304 byte
s=0

1 个答案:

答案 0 :(得分:0)

您将使用带有S3的Paperclip

问题是你错过了模型中的:bucket选项。以下是修复方法:

#app/models/pin.rb
Class Pin < ActiveRecord::Base
    has_attached_file :image,
            :styles => { :medium => "x300", :thumb => "x100" },
            :storage => :s3,
            :bucket => '******',
            :s3_credentials => {:access_key_id => ENV['S3_KEY'], :secret_access_key => ENV['S3_SECRET']}
end