2015-02-24 48 views
1

任何人都可以幫助我解決以下錯誤。當我試圖訪問「http://localhost:3000」時,它向我顯示下面的錯誤。如何解決來自ROR的Sass :: SyntaxError

錯誤:

Sass::SyntaxError in Users#index 

Showing C:/Site/bootstrap_playground/app/views/layouts/application.html.erb where line #5 raised: 

File to import not found or unreadable: bootstrap-sprockets. 
Load paths: 
    Sass::Rails::Importer(C:/Site/bootstrap_playground/app/assets/stylesheets/users.css.scss) 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/bootstrap-sass-3.1.1.1/vendor/assets/stylesheets 
    (in C:/Site/bootstrap_playground/app/assets/stylesheets/users.css.scss) 

我的代碼如下:

的Gemfile
source 'https://rubygems.org' 

gem 'rails', '3.2.19' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

gem 'sqlite3' 


# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 

    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    # gem 'therubyracer', :platforms => :ruby 

    gem 'uglifier', '>= 1.0.3' 
end 

gem 'jquery-rails' 

# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# To use Jbuilder templates for JSON 
# gem 'jbuilder' 

# Use unicorn as the app server 
# gem 'unicorn' 

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'debugger' 
gem 'bootstrap-sass', '~> 3.1.1.1' 

佈局/ application.html.erb

<!DOCTYPE html> 
<html> 
<head> 
    <title>BootstrapPlayground</title> 
    <%= stylesheet_link_tag "application", :media => "all" %> 
    <%= javascript_include_tag "application" %> 
    <%= csrf_meta_tags %> 
</head> 
<body> 
<header class="navbar navbar-fixed-top navbar-inverse"> 
     <div class="container"> 
     <%= link_to "sample app", '#', id: "logo" %> 
     <nav> 
      <ul class="nav navbar-nav navbar-right"> 
      <li><%= link_to "Home", '#' %></li> 
      <li><%= link_to "Help", '#' %></li> 
      <li><%= link_to "Log in", '#' %></li> 
      </ul> 
     </nav> 
     </div> 
    </header> 
    <div class="container"> 
     <%= yield %> 
    </div> 
</body> 
</html> 

樣式表/ users.css .scss

@import "bootstrap-sprockets"; 
@import "bootstrap"; 
body { 
    padding-top: 60px; 
} 

section { 
    overflow: auto; 
} 

textarea { 
    resize: vertical; 
} 

.center { 
    text-align: center; 
} 

.center h1 { 
    margin-bottom: 10px; 
} 
h1, h2, h3, h4, h5, h6 { 
    line-height: 1; 
} 

h1 { 
    font-size: 3em; 
    letter-spacing: -2px; 
    margin-bottom: 30px; 
    text-align: center; 
} 

h2 { 
    font-size: 1.2em; 
    letter-spacing: -1px; 
    margin-bottom: 30px; 
    text-align: center; 
    font-weight: normal; 
    color: #777; 
} 

p { 
    font-size: 1.1em; 
    line-height: 1.7em; 
    } 

請檢查所有的代碼,並使其正確無誤。

+0

您是否完成了捆綁安裝,您是否重新啓動服務器, – 2015-02-24 13:17:03

回答

相關問題