2012-03-16 89 views
4

我正在升級Rails 3.1應用程序以使用資產管道。我已將「jquery-rails」gem包含在我的Gemfile中,並通過運行bundle install進行安裝。在app /資產/ JavaScript的目錄Rails 3.1資產管道預編譯錯誤 - 找不到文件'jquery'

Using jquery-rails (1.0.19) 

我的application.js文件看起來像這樣:

// ... 
//= require jquery 
//= require jquery_ujs 
//= require jquery-ui 
//= require_tree . 
... 

當我運行bundle exec rake assets:precompile我得到以下錯誤:

** Invoke assets:precompile (first_time) 
** Execute assets:precompile 
/Users/augus164/.rvm/rubies/ruby-1.9.3-p0/bin/ruby /Users/augus164/.rvm/gems/ruby-1.9.3-p0/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace 
** Invoke assets:precompile:all (first_time) 
** Execute assets:precompile:all 
** Invoke assets:precompile:primary (first_time) 
** Invoke assets:environment (first_time) 
** Execute assets:environment 
** Invoke environment (first_time) 
** Execute environment 
** Invoke tmp:cache:clear (first_time) 
** Execute tmp:cache:clear 
** Execute assets:precompile:primary 
rake aborted! 
couldn't find file 'jquery' 

這是我的理解通過包含jquery-rails gem,我不需要在我的javascripts目錄中包含jquery庫,或者從google cdn鏈接到它。任何人都知道我錯過了什麼?

回答

0

如果您使用rails 3.1,則不需要寶石。它在默認情況下包含在rails中。

+0

沒錯。我想我應該說我沒有評論寶石,因爲我以前沒有使用它。 – 2012-03-16 20:45:45