在本地测试,上传成功,然后运行到服务器 (阿里云) 后,图片不能上传。
排查原因: 1.ImageMagick 问题,已经安装,,,,
运行 convert -version 显示:Version: ImageMagick 6.6.9-7 2014-03-06 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC Features: OpenMP
2.服务器前端用 nginx 代理,超时是默认的 60s,大小是 10M, 3.本地测试的时候能够成功,
请问,请高人指点,给解题思路!
已经成功上传,非常感谢 Qing Wang
#10 楼 @blacktulip 难免有大神如此热忱,首先表示感谢!
2014/03/18 21:30:15 [warn] 32767#0: server name "http://www.soulmorning.com/" has suspicious symbols in /opt/nginx/conf/nginx.conf:50
[ 2014-03-18 21:30:15.6720 300/7f346a7c1740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/local/rvm/gems/ruby-2.0.0-p451/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.39', 'passenger_version' => '4.0.39', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.39', 'web_server_pid' => '32767', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '0', 'web_server_worker_uid' => '0' }
[ 2014-03-18 21:30:15.6775 303/7f0a501c8740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.32767/generation-0/request
[ 2014-03-18 21:30:15.6875 308/7fd65be77740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.32767/generation-0/logging
[ 2014-03-18 21:30:15.6925 300/7f346a7c1740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-03-18 21:31:13.2108 424/7f893394a740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/local/rvm/gems/ruby-2.0.0-p451/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.39', 'passenger_version' => '4.0.39', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.39', 'web_server_pid' => '423', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '0', 'web_server_worker_uid' => '0' }
[ 2014-03-18 21:31:13.2154 427/7fad20dee740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.423/generation-0/request
"error.log" 17602L, 2176818C
#13 楼 @blacktulip 时间戳错误意味着没有使用 nginx 代理,我知道了,以前我用的是这个东西的代理,换了项目,一直部署不上,我就用直接 rails s -e production 了,所以错误没有记录!这个东西是没法排查了,production.log 也没有记录,那就只有 rack server 了!!请问 rack server 的 log 信息在哪,
#16 楼 @blacktulip 大神还在吗?错误是这个样子的!
App 25084 stderr: Started POST "/users" for 123.101.172.56 at 2014-05-14 22:12:56 +0800
App 25084 stderr: Processing by UsersController#create as HTML
App 25084 stderr: Parameters: {"utf8"=>"✓", "authenticity_token"=>"o1ph6phzIk9WZwfM8ebAw8+8cDonM9QJLFzyLXbAXew=", "user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "avatar"=>#<ActionDispatch::Http::UploadedFile:0x000000020d37c8 @tempfile=#<Tempfile:/tmp/RackMultipart20140514-25113-mbvm3g>, @original_filename="QQ20130517-1.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"user[avatar]\"; filename=\"QQ20130517-1.png\"\r\nContent-Type: image/png\r\n">}, "commit"=>"Create my account"}
App 25084 stderr: Completed 500 Internal Server Error in 107ms
App 25084 stderr:
App 25084 stderr: Errno::EACCES (Permission denied - /home/root/www/date_around/public/uploads/tmp/20140514-2212-25113-2775):
App 25084 stderr: app/controllers/users_controller.rb:8:in `create'