2010-10-04 117 views
1

再生样式表我有一个不产生适当的样式表一个Ruby on Rails应用程序。有时SASS不会将SCSS编译为CSS,有时它们不会生成串联的CSS。我基本上得到一个错误写文件,就像这样:的Ruby on Rails应用程序不能在部署

Error Message: 
Errno::EACCES: Permission denied - /var/www/app/releases/20101004114929/public/stylesheets/cached_tutor24_tutor24-dot-ch-dot-simplificator-dot-com.css 

Where: 
pages#show 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/helpers/asset_tag_helper.rb, line 673 

Backtrace Summary: 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/helpers/asset_tag_helper.rb:673:in `initialize' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/helpers/asset_tag_helper.rb:673:in `open' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/helpers/asset_tag_helper.rb:673:in `write_asset_file_contents' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/helpers/asset_tag_helper.rb:433:in `stylesheet_link_tag' 
[PROJECT_ROOT]/app/helpers/application_helper.rb:28:in `robust_stylesheet_link_tag' 
[PROJECT_ROOT]/app/views/layouts/application.html.haml:28:in `_run_haml_app47views47layouts47application46html46haml' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/renderable.rb:34:in `send' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/renderable.rb:34:in `render_without_trace_View_path_r_2_Rendering' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/base.rb:306:in `with_template' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/renderable.rb:30:in `render_without_trace_View_path_r_2_Rendering' 
[GEM_ROOT]/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:319:in `render' 
[GEM_ROOT]/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:141:in `trace_execution_scoped' 
[GEM_ROOT]/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:314:in `render' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/template.rb:205:in `render_template' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/base.rb:265:in `render_without_haml' 
[GEM_ROOT]/gems/haml-3.0.18/rails/./lib/haml/helpers/action_view_mods.rb:13:in `render' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/base.rb:352:in `_render_with_layout' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_view/base.rb:262:in `render_without_haml' 
[GEM_ROOT]/gems/haml-3.0.18/rails/./lib/haml/helpers/action_view_mods.rb:13:in `render' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/base.rb:1250:in `render_for_file' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/base.rb:936:in `render_without_benchmark' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/benchmarking.rb:51:in `render' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/benchmarking.rb:51:in `render' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/base.rb:1326:in `default_render' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/base.rb:1332:in `perform_action_without_filters' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/filters.rb:617:in `call_filters' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/rescue.rb:160:in `perform_action_without_flash' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/flash.rb:151:in `perform_action_without_newrelic_trace' 
[GEM_ROOT]/gems/newrelic_rpm-2.13.1/lib/new_relic/control/./agent/instrumentation/controller_instrumentation.rb:254:in `perform_action' 
[GEM_ROOT]/gems/newrelic_rpm-2.13.1/lib/new_relic/agent/method_tracer.rb:141:in `trace_execution_scoped' 
[GEM_ROOT]/gems/newrelic_rpm-2.13.1/lib/new_relic/control/./agent/instrumentation/controller_instrumentation.rb:247:in `perform_action' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/base.rb:532:in `send' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/base.rb:532:in `process_without_filters' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/filters.rb:606:in `process' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/base.rb:391:in `process' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/base.rb:386:in `call' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/routing/route_set.rb:438:in `call' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/dispatcher.rb:87:in `dispatch' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/dispatcher.rb:121:in `_call' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack' 
[GEM_ROOT]/gems/haml-3.0.18/rails/./lib/sass/plugin/rack.rb:41:in `call' 
[GEM_ROOT]/gems/haml-3.0.18/rails/./lib/sass/plugin/rack.rb:41:in `call' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/string_coercion.rb:25:in `call' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/params_parser.rb:15:in `call' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/session/abstract_store.rb:177:in `call' 
[GEM_ROOT]/gems/activerecord-2.3.9/lib/active_record/query_cache.rb:29:in `call' 
[GEM_ROOT]/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' 
[GEM_ROOT]/gems/activerecord-2.3.9/lib/active_record/query_cache.rb:9:in `cache' 
[GEM_ROOT]/gems/activerecord-2.3.9/lib/active_record/query_cache.rb:28:in `call' 
[GEM_ROOT]/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/failsafe.rb:26:in `call' 
[GEM_ROOT]/gems/actionpack-2.3.9/lib/action_controller/dispatcher.rb:106:in `call' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/rack/request_handler.rb:92:in `process_request' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:441:in `start_request_handler' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:381:in `handle_spawn_application' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/utils.rb:252:in `safe_fork' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:377:in `handle_spawn_application' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:352:in `__send__' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:352:in `main_loop' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:163:in `start' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:222:in `start' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rails_application' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:247:in `spawn_rails_application' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rails_application' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:145:in `spawn_application' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:278:in `handle_spawn_application' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:352:in `__send__' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:352:in `main_loop' 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously' 

整个/无功/网络/应用程序设置为属于www数据:WWW的数据与权限UG + RWX,一个在几次部署时间。

即使部署我可以去检查权限和他们的罚款后:

# ls -la current/public/stylesheets/ 
total 92 
drwxrwxr-x 2 www-data www-data 4096 Oct 4 14:11 ./ 
drwxrwxr-x 6 www-data www-data 4096 Oct 4 13:49 ../ 

,它仍然无法创建(或读取文件)。

任何想法可能会发生什么?

回答

1
  1. Web服务器是否真的如运行www数据的用户?
  2. 是不是有一些FS错误? (dmesg的)
  3. 是“目前”符号链接指向了在跟踪显示在“版本”相同的目录?
  4. ,如果你对当前/公共/样式改变为777,会发生什么?
+0

1:是的,它;我已经检查过,以防万一。明天当我回到办公室时,我会在2,3和4号工作。感谢你的回答。 – Pablo 2010-10-04 18:37:22

+0

2:没有文件系统错误。 3:是的,它是同一个目录。 4:我已经将它添加到我们的部署过程中,并开始工作,我将其删除,并继续工作......所以不确定。 – Pablo 2010-10-11 10:46:02

1
+0

那么,它应该作为www-data运行,因为它是config/environment.rb的所有者。在短时间内,所有者是root,实际上乘客是以root身份运行的,尽管文档说它永远不会以root身份运行。 – Pablo 2010-10-11 10:13:42

+0

Phusion Passenger可以以root身份运行一些内部帮助进程,但应用程序本身所有的“Rails:...”和“Rack:...”进程永远不会以root身份运行。根据ps,它们运行的​​是什么? – Hongli 2010-10-11 18:20:53

相关问题