Rack应用程序对象中的异常ArgumentError(找不到临时目录)(进程16899,线程0x00000002f00c38(Worker 1))

时间:2014-07-22 17:49:16

标签: ruby-on-rails gem rubygems passenger

当我尝试在rails admin中编辑图像时出现以下错误。我使用AWS S3进行图像存储。请允许任何人在这个问题上帮助我。

App 16883 stderr: [ 2014-07-22 13:29:10.2777 16899/0x00000002f00c38(Worker 1) utils.rb:72 ]: *** Exception ArgumentError in Rack application object (could not find a temporary directory) (process 16899, thread 0x00000002f00c38(Worker 1)):
App 16883 stderr:   from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tmpdir.rb:34:in `tmpdir'
App 16883 stderr:   from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tmpdir.rb:105:in `tmpdir'
App 16883 stderr:   from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tmpdir.rb:137:in `create'
App 16883 stderr:   from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tempfile.rb:136:in `initialize'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/multipart/parser.rb:104:in `new'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/multipart/parser.rb:104:in `get_current_head_and_filename_and_content_type_and_name_and_body'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/multipart/parser.rb:19:in `block in parse'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/multipart/parser.rb:17:in `loop'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/multipart/parser.rb:17:in `parse'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/multipart.rb:25:in `parse_multipart'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/request.rb:377:in `parse_multipart'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/request.rb:203:in `POST'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:26:in `method_override'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:14:in `call'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in `call'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/engine.rb:511:in `call'
App 16883 stderr:   from /var/www/proj_folder/shared/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/application.rb:97:in `call'
App 16883 stderr:   from /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-4.0.46/lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
App 16883 stderr:   from /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-4.0.46/lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
App 16883 stderr:   from /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-4.0.46/lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
App 16883 stderr:   from /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-4.0.46/lib/phusion_passenger/request_handler.rb:448:in `block (3 levels) in start_threads'
[Tue Jul 22 13:29:10.278504 2014] [core:error] [pid 16796:tid 140717607311104] [client 117.207.82.237:39405] End of script output before headers: admin

我还提到了之前的一些问题,但没有运气。

  1. Ruby: Could not find a temporary directory
  2. Rails could not find a temporary directory (ArgumentError)
  3. 我还尝试为tm目录设置环境 https://help.ubuntu.com/community/EnvironmentVariables

    当我开始在端口3000上运行我的应用程序时,它正在正确保存图像。

0 个答案:

没有答案