我将 config/environments/development.rb 复制到 config/environments/ci.rb。
当我使用 RAILS_ENV=development 运行时,资产搜索路径包括我的 gem 供应商目录,尤其是 jquery-ui-rails。但是,当我使用 RAILS_ENV=ci 运行时,它不会。
从控制台,Rails.application.config.assets.paths 评估为以下开发
irb(main):002:0> Rails.application.config.assets.paths
=> ["/var/www/ci/conflux/app/assets/images",
"/var/www/ci/conflux/app/assets/javascripts",
"/var/www/ci/conflux/app/assets/stylesheets",
"/var/www/ci/conflux/vendor/assets/stylesheets",
"/opt/comcast/ruby1.9.3/lib/ruby/gems/1.9.1/gems/jquery-rails-1.0.19/vendor/assets/javascripts",
"/opt/comcast/ruby1.9.3/lib/ruby/gems/1.9.1/gems/jquery-ui-rails-1.0.0/vendor/assets/images",
"/opt/comcast/ruby1.9.3/lib/ruby/gems/1.9.1/gems/jquery-ui-rails-1.0.0/vendor/assets/javascripts",
"/opt/comcast/ruby1.9.3/lib/ruby/gems/1.9.1/gems/jquery-ui-rails-1.0.0/vendor/assets/stylesheets"]
但对于 ci 我只得到以下内容:
irb(main):002:0> Rails.application.config.assets.paths
=> ["/var/www/ci/conflux/app/assets/images",
"/var/www/ci/conflux/app/assets/javascripts",
"/var/www/ci/conflux/app/assets/stylesheets",
"/var/www/ci/conflux/vendor/assets/stylesheets",
"/opt/comcast/ruby1.9.3/lib/ruby/gems/1.9.1/gems/jquery-rails-1.0.19/vendor/assets/javascripts"]