Errno::ENOENT 没有这样的文件或目录 Rails 4 [英] Errno::ENOENT No such file or directory Rails 4

查看:44
本文介绍了Errno::ENOENT 没有这样的文件或目录 Rails 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在第 5 行提出的位置显示/Users/Christian/Desktop/sample_app/app/views/layouts/application.html.erb":

Showing "/Users/Christian/Desktop/sample_app/app/views/layouts/application.html.erb" where line #5 raised:

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

No such file or directory - /Users/Christian/Desktop/vendor/assets (in /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 在正确的位置

I was developing on linux ubuntu and it works fine there, I copied the folder to my mac and it no longer works. custom.css.scss is in the correct location

问题出在第 5 行:

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

推荐答案

将 sass-rails 版本更改为 4.0.3,其余保持原样.必要时删除 Gemfile.lock,然后:

Change sass-rails version to 4.0.3 and leave the rest as it is. Remove Gemfile.lock when necessary, and then:

$ bundle update
$ bundle install

最后,不要忘记重启你的rails服务器!

Finally, don't forget to restart your rails server!

这篇关于Errno::ENOENT 没有这样的文件或目录 Rails 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆