Rails 3.2资产管道在生产与开发中编译不同版本的jquery

时间:2015-05-29 05:31:57

标签: jquery ruby-on-rails jquery-mobile asset-pipeline jquery-rails

我有一个Rails 3.2应用程序,在开发环境中一切正常,而在生产中(passenger / apache2)我有javascript的奇怪问题。

我的宝石文件是:

 source 'https://rubygems.org'
 gem 'rails', '3.2.13'
 gem 'sqlite3',   :platforms => [:ruby]
 gem 'debugger',  :platforms => [:ruby]
 gem 'execjs', :platforms => [:ruby]
 gem 'therubyracer', :platforms => [:ruby]
 gem 'tiny_tds',   :platforms => [:mingw, :ruby]
 gem 'activerecord-sqlserver-adapter',   :platforms => [:mingw, :ruby]
 gem 'activerecord-jdbcmssql-adapter',   :platforms => [:jruby]
 gem 'jruby-openssl',   :platforms => [:jruby]
 gem 'ruby-debug',   :platforms => [:jruby]
 gem 'ruby-debug19',   :platforms => [:mingw]

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

 gem 'jquery-rails', '~> 2.2.1'
 gem 'jquery_mobile_rails'
 gem 'mobylette', '3.4.1'
 gem 'json'
 gem 'devise', '2.2.4'
 gem 'savon',   '~> 1.2.0'
 gem 'paperclip', '~> 3.0'
 gem 'prawn'
 gem 'capistrano'

app / assets中的文件是

app
  assets
     javascript
        application.js
        myscripts.js

和application.js是

//= require jquery
//= require jquery_ujs
//= require jquery.mobile
//= require_directory .

开发环境加载

jquery.js          (version 1.9.1, 9598 lines)
jquery.mobile.js   (version 1.3.0, 11093 lines)
jquery_ujs.js      (                 393 lines)

生产环境,js文件按以下顺序复制到application.js中:

 line     1 to  9598:  jquery.js         version 1.9.1
 line  9599 to  9627:  jquery mobile version 1.4.5  - only 28 lines of code
 line  9628 to 10338:  jquery ui core
 line 10339 to 25053:  other functions
 line 25054 to 25446:  jquery ujs

为什么我在devel和prod中有两个不同的jquery移动版本? Devel工作,生产没有。 我如何检查rake资产:precompile --trace RAILS_ENV = production应该做什么以及它真正做什么?

0 个答案:

没有答案