rake assets:预编译失败,没有有用的错误

时间:2013-04-17 23:28:02

标签: ruby-on-rails rake asset-pipeline

我正在尝试对我的资产进行预编译,但每当我尝试失败时都会出现错误,但除了那个之外没有告诉我任何其他信息,所以我不知道它来自何处或如何找到它。我正在运行rake assets:precompile --trace并获得以下输出

** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/nginx/.rvm/rubies/ruby-1.9.3-p327/bin/ruby /home/nginx/.rvm/gems/ruby-1.9.3-p327/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
undefined method `[]' for nil:NilClass
Command failed with status (1): [/home/nginx/.rvm/rubies/ruby-1.9.3-p327/bi...]

这是完整的输出,我没有削减任何东西。如您所见,我只是收到错误但没有位置或其他任何内容。

有什么方法可以轻松追踪这个吗?

1 个答案:

答案 0 :(得分:0)

好吧,我把它想出来......等等。 所以我大致知道为什么我收到错误但仍然没有错误的实际原因以及它是哪个文件:(

但基本上,我已经改变了由rails预编译的文件,而我使用的方法导致所有css文件都被预编译,无论我是否将文件导入application.css.scss

然后导致一些SASS mixins找不到,并且出于某种原因,拥有我拥有的资产压缩设置,导致我只是得到我最初发布的错误。

一旦我禁用压缩,我得到了一个更有帮助的错误,最终导致我找到最终的解决方案。

谢谢:)

相关问题