无法在生产环境中上传回形针图像 (AWS)



我在生产中上传回形针似乎有问题。我已经使用 Capistrano 部署到 AWS。这是我尝试为用户上传图像时收到的错误。

Started GET "/" for 127.0.0.1 at 2013-10-02 19:40:48 +0000
Processing by PagesController#home as */*
  Rendered pages/home.html.erb within layouts/application (1.1ms)
Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms | Solr: 0.0ms)
Started PUT "/users/19" for 98.198.30.70 at 2013-10-02 19:41:09 +0000
Processing by UsersController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"0cCRXGjztCv0vs3sxdEcv98aEKTzGcNOXumh6hYPVMU=", "user"=>{"username"=>"chicken", "email"=>"cc@cc.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "avatar"=>#<ActionDispatch::Http::UploadedFile:0x00000006f95f00 @original_filename="download.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name="user[avatar]"; filename="download.jpg"rnContent-Type: image/jpegrn", @tempfile=#<File:/tmp/RackMultipart20131002-766-swwl63>>}, "commit"=>"Update Profile", "id"=>"19"}
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: convert '/tmp/download20131002-766-1bap7m5.jpg[0]' -auto-orient -resize "150x150>" '/tmp/download20131002-766-1bap7m520131002-766-12kdsu8'
Command :: file -b --mime '/tmp/download20131002-766-1bap7m520131002-766-12kdsu8'
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: convert '/tmp/download20131002-766-1bap7m5.jpg[0]' -auto-orient -resize "300x300>" '/tmp/download20131002-766-1bap7m520131002-766-d8rgc4'
Command :: file -b --mime '/tmp/download20131002-766-1bap7m520131002-766-d8rgc4'
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: convert '/tmp/download20131002-766-1bap7m5.jpg[0]' -auto-orient -resize "100x100>" '/tmp/download20131002-766-1bap7m520131002-766-138s58z'
Command :: file -b --mime '/tmp/download20131002-766-1bap7m520131002-766-138s58z'
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: identify -format %m '/tmp/download20131002-766-1bap7m5.jpg[0]'
Command :: convert '/tmp/download20131002-766-1bap7m5.jpg[0]' -auto-orient -resize "50x50>" '/tmp/download20131002-766-1bap7m520131002-766-wyvzz0'
Command :: file -b --mime '/tmp/download20131002-766-1bap7m520131002-766-wyvzz0'
Completed 500 Internal Server Error in 3695ms
Errno::EEXIST (File exists - /home/app/xxx.com/current/public/system):
  app/controllers/users_controller.rb:94:in `update'

这是视图生成的图像链接:

<img alt="10-m" src="/system/styles/dimages/000/000/519/original/10-m.jpg?1379454321">

但是,当我尝试在我的应用程序中浏览到此目录时,我无法浏览。也许是权限问题? 系统的文件夹名称显示为红色

app@mothership:~/xxx.com/current/public$ ls
403.html  404.html  422.html  500.html  assets  favicon.ico  robots.txt  system
app@mothership:~/xxx.com/current/public$ cd system
-bash: cd: system: No such file or directory

回形针正在尝试创建/home/app/xxx.com/current/public/system目录,但它已经存在。这可能是由于 Capistrano 部署中的符号链接无效。

检查文件并使用ls -l查看,看看它是否是指向正确位置的符号链接。如果没有,请通过创建目标或更改位置来更新符号链接。

相关内容

  • 没有找到相关文章

最新更新