我在布局文件中添加了这一行:
<%= stylesheet_link_tag "bootstrap", "bootstrap-responsive", :cache => true%>
产生此错误消息的原因:
Errno::ENOENT in Test#index
No such file or directory - Asset file not found at '/Developer/Workspace/MyProj/public/stylesheets/Developer/Workspace/MyProj/app/assets/stylesheets/bootstrap.css'
在查找文件之前,它似乎已将文件夹路径连接了两次。这是 rails 3.2.3 的已知问题吗?还是我搞砸了某些设置?
最佳答案
尝试删除“:cache => true”
If you take a look at https://github.com/rails/rails/pull/6752/files#L0R40 you will see the line, which produces wrong path when cache or concat options are enabled. In this case paths will looks like "/Absolute/path/to/public/" + "/Absolute/path/to/asset/file.ext" which is wrong.
-- Rails pull request that seems to be related to your issue.
关于ruby-on-rails - Assets 管道在错误的目录中查找,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11425749/