开发者

Asset Pipeline: Trouble on deploying my Rails 3.1 application with Capistrano

I am using Ruby on Rails 3.1.0 and Capistrano. I have a problem on make the application to work in production mode (the remote machine is running Ubuntu 10.4 - my local machine is a MacOS running Snow Leopard 10.6.7).

When I deploy with Capistrano I get this error:

uninitialized constant Rake::DSL

When I try to access a web page I get this error:

ActionView::Template::Error (application.css isn't precompiled)

What I should to do in order to make the application to work in production mode on the remote machine?


In my Capfile file I have:

# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'

In m开发者_如何学运维y Gemfile file I have:

group :production do
  gem 'execjs'
  gem 'therubyracer'
end

If I comment the load 'deploy/assets' I do not get anymore the uninitialized constant Rake::DSL but I get still the ActionView::Template::Error (application.css isn't precompiled) error.


See:

http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets

"
If you have other manifests or individual stylesheets and JavaScript 
files to include, you can add them to the precompile array:

config.assets.precompile += ['admin.js', 'admin.css', 'swfObject.js']
"


Try to add config.assets.compile = true in production.rb. Hope that helps.


Try to create new Rails 3.1 project with scaffolding and deploy it. If everything will be ok, compare configs and other files with your real project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜