【发布时间】:2012-11-20 06:40:23
【问题描述】:
在我的生产服务器上运行 rake assets:precompile 时出现错误。据我所知,在这件事发生之前我没有做任何不同的事情。在我的开发机器上运行rake assets:precompile 不会产生任何错误。我不确定如何调试它。建议?我尝试使用 --trace 选项运行,但它并没有真正为我提供更多有用的信息来指出代码中的错误。
deploy@example.com:~/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/ruby-1.9.3-p194@global/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时我没有收到此错误。 -
只是大声思考,您的 Gemfile 的开发部分中是否有可能导致此问题的 gem?例如。萨斯?
-
我在资产组中有
sass-rails以及twitter-bootstrap-rails。
标签: ruby-on-rails twitter-bootstrap rake twitter-bootstrap-rails