2013-04-15 49 views
1

我想測試示例Rails應用程序以使用select2 gem。我已經安裝了以下select2-rails的寶石。使用select2 gem與Rails時的鏈輪:: FileNotFound 3.2.8

但不幸的是我收到以下錯誤:

Sprockets::FileNotFound in Home#index 

Showing /Users/Rakib/Desktop/Development/TEST_PROJECTS/selecttest/app/views/layouts/application.html.erb where line #5 raised: 

couldn't find file 'select2' 
    (in /Users/Rakib/Desktop/Development/TEST_PROJECTS/selecttest/app/assets/stylesheets/application.css:14) 
Extracted source (around line #5): 

2: <html> 
3: <head> 
4: <title>Selecttest</title> 
5: <%= stylesheet_link_tag "application", :media => "all" %> 
6: <%= javascript_include_tag "application" %> 
7: <%= csrf_meta_tags %> 
8: </head> 
Rails.root: /Users/Rakib/Desktop/Development/TEST_PROJECTS/selecttest 

我的Gemfile是:

source 'https://rubygems.org' 

gem 'rails', '3.2.8' 
gem 'sqlite3' 

group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 
    gem 'uglifier', '>= 1.0.3' 
end 

gem 'jquery-rails' 
gem 'jquery-rails' 
gem "select2-rails" 

的application.js是:

//= require jquery 
//= require jquery_ujs 
//= require select2 
//= require_tree . 

application.css是:

*= require_self 
*= require_tree . 
*= require select2 

我在這裏失蹤了什麼?

+2

我猜服務器需要重新啓動。你能以這種方式解決問題嗎? –

+0

在我的情況 - 我錯誤地在我的項目不工作的rvm中安裝了gem「select2-rails」 – shilovk

回答

12

我遇到了同樣的問題。問題通過重新啓動服務器解決。

+0

我在rails中感覺這樣的noob。 –