动作控制器:异常在帖子#index中捕获了Sass :: SyntaxError

时间:2015-03-12 05:13:44

标签: ruby-on-rails syntax-error

我一直在这里关注教程:http://railsinstallfest.org/guides/installfest41/finishing_a_basic_blog/

我遇到了这个错误:Action Controller: Exception Caught

我已经更新了许多文件:

    app/assets/stylesheets/foundation_and_overrides.scss:58
    app/views/layouts/application.html.erb:5:in          `_app_views_layouts_application_html_erb___3962393091843783815_70202089917300'
    app/controllers/posts_controller.rb:10:in `index'

而且我觉得我在附近的某个地方被绊倒了:

按n然后输入以跳过覆盖我们的 application.html.erb 布局文件。通过跳过这个我们确实错过了Foundation的一些响应式设计功能,但是我们已经将我们的RSS链接添加到我们的布局文件中并允许安装覆盖我们的布局文件意味着我们将丢失该链接。如果您愿意将autodiscovery链接标记放回到新的布局文件中,请重新运行基础安装并允许它覆盖您的布局。

    app/assets/stylesheets/foundation_and_overrides.scss:58  
        // This is the default html and body font-size for the base rem value.
        // $rem-base: 16px;

        // Allows the use of rem-calc() or lower-bound() in your settings
        Line 58: @import "foundation/functions";

        app/views/layouts/application.html.erb:5:in    `_app_views_layouts_application_html_erb___3962393091843783815_70202089917300'

    Extracted source (around line #5):
    3<head>
    4  <title>QuickBlog</title>
    5  <%= stylesheet_link_tag    "application", media: "all", "data-  turbolinks-track" => true %>
    6  <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
    7  <%= csrf_meta_tags %>
    8  <%= auto_discovery_link_tag(:atom, posts_path(:atom)) %>

    app/controllers/posts_controller.rb:10:in `index'
    Extracted source (around line #10):
    8    def index
    9      @posts = Post.all
   10     respond_to do |format|
   11       format.html # index.html.erb
   12       format.json { render json: @posts }
   13       format.atom

我使用的是Mac OSX 10.9.5,Rails 4.2.0,Ruby 2.0.0p576

1 个答案:

答案 0 :(得分:0)

在文件app / assets / stylesheets / foundation_and_overrides.scss的第58行,它看起来像是:

@import "foundation/functions";

您可以尝试将其更改为:

@import "functions";

服务器重启可能有所帮助(如果你还没有这样做的话) - 有时候在添加gem之后就有必要了。

相关问题