user12882
user12882

Reputation: 4792

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

Upvotes: 2

Views: 8182

Answers (3)

Kir
Kir

Reputation: 8111

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.

Upvotes: 0

Jim Soho
Jim Soho

Reputation: 2048

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

Upvotes: 3

railscard
railscard

Reputation: 1848

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

Upvotes: 0

Related Questions