ruby-on-rails - Assets 管道在错误的目录中查找

标签 ruby-on-rails asset-pipeline

我在布局文件中添加了这一行:

<%= 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/

相关文章:

jquery - 使用 asset pipeline 和 pjax 时未捕获的 ReferenceError

ruby-on-rails-3.2 - 在 Rails Asset Pipeline 中使用索引文件

ruby-on-rails - 使用火箭裤时如何配置JSON响应?

ruby-on-rails - Rails link_to 用 remote=>true 阻塞?

Javascript更改请求 header : accept-language parameter

ruby-on-rails - 为什么 Heroku 返回 'devise/sessions.js isn' t precompiled'?

javascript - Jit Tree JS 和 Assets 预编译错误

ruby-on-rails - 我们在哪里声明 Rails 模型的属性?

ruby-on-rails - 为什么 'coffee-rails'在:assets group while 'jquery-rails' is in the :default group in a new Rails project's Gemfile?

css - 直接将文件夹添加到 Assets 路径