0

I am deploying my ruby rails application with capistrano and have an development, staging and production environment. On my development env everything works fine.

Now I've pushed my updates to our staging env but no new application.css has been generated. I have deleted the old application.css manually on the staging env and tried my deployment again - without any luck. All I get now is an error from the web console, that application-xxxxx.cs could not be found. How can I generate a new application.css?

I have already tried it with cap staging deploy assets:precompile but without any luck.

In my staging.rb:

 config.assets.compile = true

In my assets.rb:

Rails.application.config.assets.version = '1.1'
Rails.application.config.assets.precompile += %w( season.css)
Rails.application.config.assets.precompile += %w( dashboard.css)
Rails.application.config.assets.paths << Rails.root.join('node_modules')

Capfile:

require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/puma'
install_plugin Capistrano::Puma
install_plugin Capistrano::Puma::Daemon
require 'whenever/capistrano'

Addition:

When I run cap staging deploy it shows that precompile is executed but as stated above no new application.css file has been generated.

00:53 deploy:assets:precompile
      01 ~/.rvm/bin/rvm default do bundle exec rake assets:precompile
    ✔ 01 deploy@3.121.33.42 5.630s

If any other information is needed, please let me know.

Rick Grimes
  • 103
  • 10
  • `config.assets.compile` is used to turn on live compiling - thats not what you want. https://stackoverflow.com/questions/8821864/config-assets-compile-true-in-rails-production-why-not – max May 10 '22 at 14:49
  • Thx, yeah it has been on false but set it to true on my second attempt – Rick Grimes May 10 '22 at 15:13
  • So to confirm it is not running precompile assets. Correct? Can you post the requires in your Capfile? – engineersmnky May 10 '22 at 18:29
  • Well if you take a look at the deploy it runs precompile, but without really precompiling a new file. I have added this to my question. – Rick Grimes May 10 '22 at 19:02

0 Answers0