在生产服务器上运行rake assets:precompile
时出现错误。据我所知,在这件事发生之前,我没有做任何不同的事情。在我的开发机器上运行rake assets:precompile
不会产生任何错误。我不知道如何调试。建议?我试着用--trace
选项运行,但它并没有给我提供任何更有用的信息来指向我在代码中的错误。耙子资产:预编译错误
[email protected]:~/www/example.com/app/assets/stylesheets$ rake assets:precompile
(in /home/deploy/www/example.com)
/home/deploy/.rvm/rubies/ruby-1.9.3-p194/bin/ruby /home/deploy/.rvm/gems/[email protected]/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Invalid CSS after "...4882640c.png"")": expected "{", was ";background-pos..."
(in /home/deploy/www/example.com/app/assets/stylesheets/application.css)
Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/home/deploy/.rvm/rubies/ruby-1.9.3-p194/b...]
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
我们需要查看上面错误中引用的CSS段 - 它看起来可能是一个语法错误。 –
是的,所以问题是我在我的开发机器上使用完全相同的CSS文件,并且当我运行'rake:assets precompile RUBY_ENV = development'时,我没有收到这个错误。 – Chiubaka
只是大声思考,你的Gemfile的开发部分是否有可能导致这种情况的宝石?例如。 SASS? –