2013-05-04 29 views
3

我在5.1.2的railstutorial中,我剛剛安裝了Bootstrap-sass(我已經仔細檢查過,這個gem在那裏)。 http://ruby.railstutorial.org/chapters/filling-in-the-layout#top添加@import「bootstrap」後出現錯誤; Static_pages中的參數錯誤#home

我添加文件: 應用程序/資產/樣式表/ custom.css.scss

當我給它這樣的內容:

@import "bootstrap"; 

我的http://本地主機:3000/static_pages/home不再有效。它給出了以下錯誤:

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' 

任何幫助將不勝感激,謝謝!

+0

您是否在不同的路徑上安裝了ruby安裝程序和您的項目? – Mindbreaker 2013-05-04 09:51:14

+0

是的,Rails安裝程序在這裏:E:\ RailsInstaller。該項目位於C:\ Sites \ rails_projects \ sample_app。這是一個問題嗎?到目前爲止一切工作正常 – user2349461 2013-05-04 10:24:38

+1

好了我的項目複製到E驅動器,這解決了問題,謝謝。我希望雖然我不會導致Github和heroku問題 – user2349461 2013-05-04 10:56:29

回答

4

你的寶石是E:,而你的應用程序是在C:\

當試圖@import,資產模塊將搜索幾個地方,包括寶石路。但它無法識別路徑中的磁盤。這就是您的@import失敗的原因。

建議:將您的應用程序和寶石放入同一個磁盤。

備註:根本不要使用Windows進行Rails開發。

+0

感謝您的解釋。你介意爲什麼Windows對Rails開發不利嗎? (對不起,我有點小菜) – user2349461 2013-05-06 18:19:01