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链接到它。任何人都知道我错过了什么?
没错。我想我应该说我没有评论宝石,因为我以前没有使用它。 – 2012-03-16 20:45:45