我创建了一个带有rails的博客应用程序,包括paperclip,aws-sdk gems。在我的应用程序中部署在Heroku上,在创建或更新帖子时,它出现Errno::ECONNREFUSED
错误,帖子没有创建或更新。
另一方面,我设置了所需的所有东西,如S3,paperclip,db。通过表单上传的图片似乎正在处理,即使它可以在AWS S3存储桶页面上看到,但不能在应用程序中看到。我需要警告,在应用程序中没有与搜索或邮件功能相关的内容。这是我在Heroku上的应用程序的完整跟踪:
posts_controller.rb
:
def create
@post = current_user.posts.new(post_params)
respond_to do |format|
if @post.save
format.html { redirect_to @post, notice: 'Post was successfully created.' }
format.json { render action: 'show', status: :created, location: @post }
else
format.html { render action: 'new' }
format.json { render json: @post.errors, status: :unprocessable_entity }
end
end
end
错误输出:
Oct 12 10:56:28 : Started POST "/posts" for 5.47.88.217 at 2013-10-12 17:56:28 +0000
Oct 12 10:56:28 : Started POST "/posts" for 5.47.88.217 at 2013-10-12 17:56:28 +0000
Oct 12 10:56:28 : Processing by PostsController#create as HTML
Oct 12 10:56:28 : Processing by PostsController#create as HTML
Oct 12 10:56:28 : Parameters: {"utf8"=>"✓", "authenticity_token"=>"VoJae1/rRl+qCKOqAtl341AQFVsXjaB9gDCpfQJeHDI=", "post"=>{"title"=>"Perferendis, repellendus, fugit ea exercitationem", "category"=>"temporibus", "content"=>"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit, voluptatibus, eum, saepe quis quos dolor veritatis quod voluptatem alias voluptatum reprehenderit sequi eos. Quasi, et cupiditate ad. Ipsum, nulla inventore voluptatem maiores incidunt illo nam quae illum vero ratione sit quod provident commodi nesciunt asperiores quaerat laboriosam culpa amet dolores recusandae. Illo, molestias, excepturi, eligendi fugiat expedita quo cumque sequi quia inventore ratione autem exercitationem atque! Aspernatur, modi, nostrum, quod aut ex nesciunt esse cum doloribus ea porro nulla minima inventore explicabo perspiciatis accusantium eum officia expedita laborum repudiandae provident libero quibusdam dicta sunt nemo at reiciendis reprehenderit nisi nobis veniam dignissimos ipsa voluptatem commodi ad qui saepe
Oct 12 10:56:28 : assumenda enim! Numquam, mollitia, dolorum cumque minima quibusdam accusantium velit odio nam corporis inventore necessitatibus nulla quidem et officiis excepturi repellat quas itaque quasi ducimus dolorem ad debitis illum non doloremque dolor deleniti soluta dignissimos dicta pariatur laborum! Mollitia, voluptatibus, at, veniam similique assumenda vitae quidem modi illo magnam nisi accusamus quaerat illum molestias. Recusandae, blanditiis, accusamus, praesentium atque sequi eligendi in aliquam natus iusto dolore sint ex quasi voluptas ab aperiam? Ipsam, perspiciatis cupiditate iste vitae repellat delectus voluptate. Modi, architecto, expedita, ipsa soluta sapiente quisquam maiores praesentium rerum dolorem recusandae nobis perspiciatis. Minima, deleniti doloribus sunt quod ut ipsum facere nihil neque vero quibusdam cum officia iure aperiam ducimus animi suscipit nobis dignissimos praesentium rerum commodi ullam dolores placeat possimus nemo deserunt! Voluptatem, cumque, recusandae, suscipit, accusamus reici
Oct 12 10:56:28 : Command :: identify -format %m '/tmp/ash20131012-2-lu2gkh.png[0]'
Oct 12 10:56:28 : Command :: identify -format %m '/tmp/ash20131012-2-lu2gkh.png[0]'
Oct 12 10:56:28 : Command :: identify -format %m '/tmp/ash20131012-2-lu2gkh.png[0]'
Oct 12 10:56:28 : Command :: identify -format %m '/tmp/ash20131012-2-lu2gkh.png[0]'
Oct 12 10:56:28 : Command :: identify -format %m '/tmp/ash20131012-2-lu2gkh.png[0]'
Oct 12 10:56:28 : Command :: identify -format %m '/tmp/ash20131012-2-lu2gkh.png[0]'
Oct 12 10:56:28 : Command :: convert '/tmp/ash20131012-2-lu2gkh.png[0]' -auto-orient -resize "100x100>" '/tmp/ash20131012-2-lu2gkh20131012-2-1y9sk7o'
Oct 12 10:56:28 : Command :: convert '/tmp/ash20131012-2-lu2gkh.png[0]' -auto-orient -resize "100x100>" '/tmp/ash20131012-2-lu2gkh20131012-2-1y9sk7o'
Oct 12 10:56:28 : Command :: file -b --mime '/tmp/ash20131012-2-lu2gkh20131012-2-1y9sk7o'
Oct 12 10:56:29 : Command :: identify -format %m '/tmp/ash20131012-2-lu2gkh.png[0]'
Oct 12 10:56:29 : Command :: identify -format %m '/tmp/ash20131012-2-lu2gkh.png[0]'
Oct 12 10:56:29 : Command :: identify -format %m '/tmp/ash20131012-2-lu2gkh.png[0]'
Oct 12 10:56:29 : Command :: identify -format %m '/tmp/ash20131012-2-lu2gkh.png[0]'
Oct 12 10:56:29 : Command :: convert '/tmp/ash20131012-2-lu2gkh.png[0]' -auto-orient -resize "220x165>" '/tmp/ash20131012-2-lu2gkh20131012-2-2tbb6d'
Oct 12 10:56:29 : Command :: convert '/tmp/ash20131012-2-lu2gkh.png[0]' -auto-orient -resize "220x165>" '/tmp/ash20131012-2-lu2gkh20131012-2-2tbb6d'
Oct 12 10:56:29 : Command :: file -b --mime '/tmp/ash20131012-2-lu2gkh20131012-2-2tbb6d'
Oct 12 10:56:29 : Command :: file -b --mime '/tmp/ash20131012-2-lu2gkh20131012-2-2tbb6d'
Oct 12 10:56:29 : [paperclip] saving /posts/captions/000/000/001/original/ash.png
Oct 12 10:56:29 : [paperclip] saving /posts/captions/000/000/001/original/ash.png
Oct 12 10:56:29 : Completed 500 Internal Server Error in 1242ms
Oct 12 10:56:29 : Completed 500 Internal Server Error in 1242ms
Oct 12 10:56:29 : Errno::ECONNREFUSED (Connection refused - connect(2)):
Oct 12 10:56:29 : app/controllers/posts_controller.rb:31:in `block in create'
Oct 12 10:56:29 : app/controllers/posts_controller.rb:30:in `create'
Oct 12 10:56:29 : Errno::ECONNREFUSED (Connection refused - connect(2)):
Oct 12 10:56:29 : app/controllers/posts_controller.rb:31:in `block in create'
Oct 12 10:56:29 : app/controllers/posts_controller.rb:30:in `create'
Oct 12 10:56:42 : Started GET "/posts" for 5.47.88.217 at 2013-10-12 17:56:42 +0000
Oct 12 10:56:42 : Started GET "/posts" for 5.47.88.217 at 2013-10-12 17:56:42 +0000
Oct 12 10:56:42 : Processing by PostsController#index as HTML
Oct 12 10:56:42 : Processing by PostsController#index as HTML
Oct 12 10:56:42 : Rendered posts/index.html.erb within layouts/application (34.8ms)
Oct 12 10:56:42 : Rendered posts/index.html.erb within layouts/application (34.8ms)
Oct 12 10:56:42 : Completed 200 OK in 51ms (Views: 14.5ms | ActiveRecord: 33.0ms)
Oct 12 10:56:42 : Completed 200 OK in 51ms (Views: 14.5ms | ActiveRecord: 33.0ms)