【问题标题】:Errno::ENOENT No such file or directory Rails 4Errno::ENOENT 没有这样的文件或目录 Rails 4
【发布时间】:2014-10-23 19:21:49
【问题描述】:

在第 5 行出现的地方显示“/Users/Christian/Desktop/sample_app/app/views/layouts/application.html.erb”:

没有这样的文件或目录 - /Users/Christian/Desktop/vendor/assets (在 /Users/Christian/Desktop/sample_app/app/assets/stylesheets/custom.css.scss)

<html>
    <head>
        <title><%= full_title(yield(:title)) %></title>
        <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
        <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
        <%= csrf_meta_tags %>
        <%= render 'layouts/shim' %>`

我在 linux ubuntu 上开发,它在那里工作正常,我将文件夹复制到我的 mac,它不再工作。 custom.css.scss 在正确的位置

问题出在第 5 行:

<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>`

【问题讨论】:

  • 你能显示你的 application.css 文件吗?
  • 可能在 application.css 中声明的某些 css 丢失了。
  • 这里是application.css /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the top of the * compiled file, but it's generally better to create a new file per style scope. * *= require_self *= require_tree . */
  • 您的供应商目录真的在桌面下还是缺少“sample_app”?
  • Mika,我的供应商目录在 sample_app 中。

标签: ruby-on-rails ruby twitter-bootstrap sass


【解决方案1】:

将 sass-rails 版本更改为 4.0.3,其余部分保持不变。必要时删除 Gemfile.lock,然后:

$ bundle update
$ bundle install

最后,别忘了重新启动您的 Rails 服务器!

【讨论】:

    【解决方案2】:

    在您的 Gemfile 中将 sass-rails 版本更改为 4.0.3。摆脱链轮的版本号。删除 Gemfile.lock。再次运行捆绑安装

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-22
      • 2015-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-09
      相关资源
      最近更新 更多