Rails - 权限被拒绝 - / home / rails / tmp / cache

时间:2014-05-07 11:02:24

标签: ruby-on-rails nginx permissions unicorn assets

每当我尝试使用'mercury'编辑器样式表加载页面时,我得到:

Started GET "/" for 84.73.28.228 at 2014-05-07 10:56:38 +0000
Processing by StaticController#index as HTML
  Rendered layouts/_socialmedia.html.erb (2.0ms)
  Rendered static/index.html.erb within layouts/application (6.8ms)
  Rendered layouts/_menu.html.erb (1.7ms)
  Rendered layouts/_footer.html.erb (1.4ms)
  Rendered layouts/_analytics.html.erb (0.3ms)
Completed 200 OK in 29ms (Views: 17.5ms | ActiveRecord: 1.3ms)
Started GET "/editor/" for 84.73.28.228 at 2014-05-07 10:56:41 +0000
Processing by MercuryController#edit as HTML
  Rendered text template within layouts/mercury (0.0ms)
Compiled jquery-1.7.js  (4ms)  (pid 26385)
Completed 500 Internal Server Error in 100ms

ActionView::Template::Error (Permission denied - /home/rails/tmp/cache/assets/D5E):
    5:     <%= csrf_meta_tags %>
    6:     <title>Mercury Editor</title>
    7:     <%= stylesheet_link_tag    'mercury' %>
    8:     <%= javascript_include_tag 'jquery-1.7', 'mercury' %>
    9:   </head>
    10:   <body>
    11:     <script type="text/javascript">
  /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir'
  /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
  /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p'
  /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each'
  /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p'
  /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:203:in `each'
  /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p'
  activesupport (3.2.11) lib/active_support/cache/file_store.rb:161:in `ensure_cache_path'
  activesupport (3.2.11) lib/active_support/cache/file_store.rb:90:in `write_entry'
  activesupport (3.2.11) lib/active_support/cache/strategy/local_cache.rb:140:in `write_entry'
  activesupport (3.2.11) lib/active_support/cache.rb:364:in `block in write'
  activesupport (3.2.11) lib/active_support/cache.rb:520:in `instrument'
  activesupport (3.2.11) lib/active_support/cache.rb:362:in `write'
  sprockets (2.2.2) lib/sprockets/caching.rb:90:in `cache_set'
  sprockets (2.2.2) lib/sprockets/caching.rb:53:in `cache_set_hash'
  sprockets (2.2.2) lib/sprockets/caching.rb:24:in `cache_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:92:in `build_asset'
  sprockets (2.2.2) lib/sprockets/base.rb:169:in `find_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:60:in `find_asset'
  sprockets (2.2.2) lib/sprockets/bundled_asset.rb:16:in `initialize'
  sprockets (2.2.2) lib/sprockets/base.rb:252:in `new'
  sprockets (2.2.2) lib/sprockets/base.rb:252:in `build_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:93:in `block in build_asset'
  sprockets (2.2.2) lib/sprockets/caching.rb:19:in `cache_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:92:in `build_asset'
  sprockets (2.2.2) lib/sprockets/base.rb:169:in `find_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:60:in `find_asset'
  sprockets (2.2.2) lib/sprockets/base.rb:177:in `[]'
  actionpack (3.2.11) lib/sprockets/helpers/rails_helper.rb:162:in `rewrite_extension'
  actionpack (3.2.11) lib/action_view/asset_paths.rb:26:in `compute_public_path'
  actionpack (3.2.11) lib/sprockets/helpers/rails_helper.rb:56:in `asset_path'
  actionpack (3.2.11) lib/sprockets/helpers/rails_helper.rb:32:in `block in javascript_include_tag'
  actionpack (3.2.11) lib/sprockets/helpers/rails_helper.rb:26:in `collect'
  actionpack (3.2.11) lib/sprockets/helpers/rails_helper.rb:26:in `javascript_include_tag'
  mercury-rails (0.9.0) app/views/layouts/mercury.html.erb:8:in `__usr_local_rvm_gems_ruby_______p____gems_mercury_rails_______app_views_layouts_mercury_html_erb__3694222398901886890_33552740'
  actionpack (3.2.11) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.11) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.11) lib/action_view/template.rb:143:in `render'
  actionpack (3.2.11) lib/action_view/renderer/template_renderer.rb:59:in `render_with_layout'
  actionpack (3.2.11) lib/action_view/renderer/template_renderer.rb:45:in `render_template'
  actionpack (3.2.11) lib/action_view/renderer/template_renderer.rb:18:in `render'
  actionpack (3.2.11) lib/action_view/renderer/renderer.rb:36:in `render_template'
  actionpack (3.2.11) lib/action_view/renderer/renderer.rb:17:in `render'
  actionpack (3.2.11) lib/abstract_controller/rendering.rb:110:in `_render_template'
  actionpack (3.2.11) lib/action_controller/metal/streaming.rb:225:in `_render_template'
  actionpack (3.2.11) lib/abstract_controller/rendering.rb:103:in `render_to_body'
  actionpack (3.2.11) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
  actionpack (3.2.11) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
  actionpack (3.2.11) lib/abstract_controller/rendering.rb:88:in `render'
  actionpack (3.2.11) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
  activesupport (3.2.11) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
  /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
  activesupport (3.2.11) lib/active_support/core_ext/benchmark.rb:5:in `ms'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
  activerecord (3.2.11) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:39:in `render'
  mercury-rails (0.9.0) app/controllers/mercury_controller.rb:9:in `edit'
  actionpack (3.2.11) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.11) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.11) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.11) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.11) lib/active_support/callbacks.rb:425:in `_run__4116608381698480854__process_action__2358713743569235138__callbacks'
  activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.11) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.11) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.11) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.11) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.11) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.11) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.11) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.11) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.11) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.11) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.11) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:73:in `call'
  actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:36:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:601:in `call'
  railties (3.2.11) lib/rails/engine.rb:479:in `call'
  railties (3.2.11) lib/rails/railtie/configurable.rb:30:in `method_missing'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:601:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.11) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.11) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `_run__3113844860461911926__call__1767113983053102621__callbacks'
  activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.11) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.11) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.11) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.11) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
  rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
  rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.11) lib/rails/engine.rb:479:in `call'
  railties (3.2.11) lib/rails/application.rb:223:in `call'
  railties (3.2.11) lib/rails/railtie/configurable.rb:30:in `method_missing'
  unicorn (4.7.0) lib/unicorn/http_server.rb:580:in `process_client'
  unicorn (4.7.0) lib/unicorn/http_server.rb:660:in `worker_loop'
  unicorn (4.7.0) lib/unicorn/http_server.rb:527:in `spawn_missing_workers'
  unicorn (4.7.0) lib/unicorn/http_server.rb:153:in `start'
  unicorn (4.7.0) bin/unicorn:126:in `<top (required)>'
  /usr/local/rvm/gems/ruby-2.0.0-p353/bin/unicorn:23:in `load'
  /usr/local/rvm/gems/ruby-2.0.0-p353/bin/unicorn:23:in `<main>'
  /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
  /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'

我试过了 chown -R rails:rails /home/rails。 我试过删除tmp并重新创建它。 我已经尝试过预编译资产并清除chache。我试过增加资产版本。 数据库访问工作正常。这一切都发生在生产环境中。我给了我的rails用户root权限,一切,但他不想放弃抱怨。

我使用数字海洋轨道液滴,它有nginx和独角兽。

有什么想法吗? 我没有从哪里开始...

1 个答案:

答案 0 :(得分:0)

在更多目录之后,我终于得到了另一个错误: ActionView::Template::Error (jquery-1.7.js isn't precompiled):

将此添加到资产管道中;然后在预编译资产上它给了我:Command failed with status ()

事实证明,数字海洋提供的默认导轨液滴是64位,500mb RAM,导致导轨完成所有这些奇怪的事情,因为它无法呼吸。从34位发行版做自己的事情解决了这个问题。