我在CSS中使用Liquid.例如,我有test.css.liquid哪些包含:
body {
background: {{ 'red' }};
}
当我运行时rake assets:precompile,它不是test.css编译但仍然test.css.liquid没有解析Liquid代码.
Sprockets使用Tilt,默认情况下有一个Liquid解析器.我在我的网站上启用了Liquid.
知道什么可能是错的吗?
我有一个使用的rails 4应用程序,ruby-filemagic因此filemagic需要在系统上安装.
我已经尝试通过模仿这个问题的解决方案在Heroku上安装它,但它只是不起作用.我尝试了很多东西,但我觉得最有希望的是安装,apt-get这要归功于(修改过的)apt-get,config和ruby buildpacks的组合.在配置中,我使用BUNDLE_BUILD__RUBY-FILEMAGIC: --with-magic-dir=/app/.apt/usr/ --with-magic-include=/app/.apt/usr/include --with-magic-lib=/app/.apt/usr/lib
最终,我仍然得到这个:
/tmp/build_29e629f8a00379850ab44096c10f1afc/vendor/ruby-2.0.0/bin/ruby extconf.rb --with-magic-dir=/tmp/build_29e629f8a00379850ab44096c10f1afc/.apt/usr/ --with-magic-include=/tmp/build_29e629f8a00379850ab44096c10f1afc/.apt/usr/include --with-magic-lib=/tmp/build_29e629f8a`00379850ab44096c10f1afc/.apt/usr/lib
checking for main() in -lgnurx... no
checking for magic_open() in -lmagic... no
*** ERROR: missing required library to compile this module
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Run Code Online (Sandbox Code Playgroud)
libmagic …
我已经看到这些错误很长时间了,但没有发现问题:
ActionView::MissingTemplate: Missing template pages/home, application/home with {:locale=>[:en], :formats=>["*/*;"]}
用户代理始终是 MSIE6(这是我之前放弃的部分原因)。
重现: curl -H "Accept: */*;" -I http://localhost:5000
有谁知道怎么修?
编辑
curl -H "Accept: */*" -I http://localhost:5000作品。仅当格式设置为*/*;(注意分号)时,它才起作用。
更新
我试图修改Mime:ALL的建议的意见,但无法拥有它同时接受*/*,并*/*;在同一时间。我看到的一个解决方案是在不存在或格式错误的 mime 类型时修补请求的处理方式,但我不确定如何处理。这个答案提供了一个线索,但我仍然没有。
更多更新
我仍然看到这些错误和更多。一个新的是:formats=>["hc/url;*/*"](Firefox)。我很惊讶这不会影响其他任何人,我认为我的代码中没有任何会导致不常见错误的特定内容。
我从defunkt 的 unicorn conf 文件中启发了我的 nginx 配置文件,但似乎该行使gzip_disable "MSIE [1-6]\.";一切都崩溃了。我收到此站点暂时不可用的错误(从 提供nginx/html/50x.html)。注释掉该行会使一切重新工作,摆弄正则表达式不会改变任何事情。
我正在运行 nginx v.1.0.10 和 ubuntu 11.10。
任何的想法?