资产管道:使用Capistrano部署我的Rails 3.1应用程序时遇到麻烦 [英] Asset Pipeline: Trouble on deploying my Rails 3.1 application with Capistrano

查看:59
本文介绍了资产管道:使用Capistrano部署我的Rails 3.1应用程序时遇到麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ruby on Rails 3.1.0和Capistrano.在使应用程序以生产模式运行时遇到问题(远程计算机运行Ubuntu 10.4,而我的本地计算机是运行Snow Leopard 10.6.7的MacOS).

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).

当我使用Capistrano进行部署时,出现此错误:

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)

我应该怎么做才能使应用程序在远程计算机上以生产模式运行?

在我的Capfile文件中,我有:

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

在我的Gemfile文件中,我有:

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

如果我评论load 'deploy/assets',我不再得到uninitialized constant Rake::DSL,但仍然出现ActionView::Template::Error (application.css isn't precompiled)错误.

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.

推荐答案

请参阅:

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

这篇关于资产管道:使用Capistrano部署我的Rails 3.1应用程序时遇到麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆