Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails production 'css isn't precompiled'

I've done this on a sister Rails 3.1 app using production on my Leopard webserver. So I didn't expect to be this lost deploying this app. I've gotten Passenger to recognize the app, but I get a '[GET /] miss' error in apache. Looking around I figure I can get this to run in webrick to see if I can isolate the issue.

bundle exec rake assets:precompile RAILS_ENV=production

But when I load up localhost:3000 I get "blueprint/screen.css isn't precompiled"

I start comparing the differences between the sister apps and cannot find them. Here are some key code they share:

<%= stylesheet_link_tag "application" %>
  <%= javascript_include_tag "application" %> #in app/views/layouts/application.html.erb

config/environments/production.rb
config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.precompile += %w( search.js )
  config.assets.precompile += %w( blueprint/screen.css blueprint/print.css )
  config.assets.precompile += %w( *.css *.js )

This happens in 3.1.0 and 3.1.3 and I can confirm the precompile happens on the blueprint directories. What am I overlooking?, sam

like image 520
sam452 Avatar asked Jan 09 '12 21:01

sam452


2 Answers

Have you tried separately like this?

config.assets.precompile += %w( blueprint/screen.css )
config.assets.precompile += %w( blueprint/print.css )

then run:

bundle exec rake assets:precompile RAILS_ENV=production

This should fixed it.

like image 72
Muhammad Sannan Khalid Avatar answered Oct 24 '22 04:10

Muhammad Sannan Khalid


You can set assets.compile to true in the production environment to fallback to assets pipeline when the file is missed.

# config/environments/production.rb
# ...
# Fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = true
like image 42
arctarus Avatar answered Oct 24 '22 05:10

arctarus