3

I'm at 5.1.2 of the railstutorial, I have just installed Bootstrap-sass (I've double checked, the gem is there). http://ruby.railstutorial.org/chapters/filling-in-the-layout#top

I added this file: app/assets/stylesheets/custom.css.scss

And when I give it this content:

@import "bootstrap";

My http://localhost:3000/static_pages/home does not work anymore. It gives the following error:

ArgumentError in Static_pages#home

Showing c:/Sites/rails_projects/sample_app/app/views/layouts/application.html.erb where line #5 raised:

different prefix: "e:/" and "c:/Sites/rails_projects/sample_app/app/assets/stylesheets"
  (in c:/Sites/rails_projects/sample_app/app/assets/stylesheets/custom.css.scss)
Extracted source (around line #5):

2: <html>
3:   <head>
4:     <title><%= full_title(yield(:title)) %></title>
5:     <%= stylesheet_link_tag    "application", :media => "all" %>
6:     <%= javascript_include_tag "application" %>
7:     <%= csrf_meta_tags %>
8:     <!--[if lt IE 9]>
Rails.root: c:/Sites/rails_projects/sample_app

Application Trace | Framework Trace | Full Trace
app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___557356520_29974776'

Any help would be much appreciated, thanks!

4

1 回答 1

4

您的宝石在E:您的应用程序中C:\

尝试@import 时,Assets 模块将搜索多个地方,包括 gem 路径。但它无法识别路径内的磁盘。这就是您的 @import 失败的原因。

建议:将您的应用程序和 gems 放在同一个磁盘中。

旁注:根本不要使用 Windows 进行 Rails 开发。

于 2013-05-04T11:30:49.123 回答