简体   繁体   中英

Rails - Permission denied - /home/rails/tmp/cache

Whenever I try to load a page with the 'mercury' editor stylesheet I get:

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>'

I've tried chown -R rails:rails /home/rails . I've tried deleting tmp and recreating it. I've tried precompiling assets and clearing the chache. I've tried increasing the asset version. Database acess works fine. This all happens in a production environment. I've given my rails user root privileges, everything, but he doesn't want to quit complaining.

I use the digital ocean rails droplet, it has nginx with unicorn.

Any ideas? I have none on where to begin...

After chown-ing some more directories, I finally get another error: ActionView::Template::Error (jquery-1.7.js isn't precompiled): .

Exclusively adding this to the asset pipeline; Then on precompiling assets it gave me: Command failed with status () .

So it turns out the default rails droplet provided by digital ocean is 64 bit with 500mb RAM, which causes rails to do all these weird things because it can't breathe. Doing my own thing from a 34 bit distro solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM