环境/开发资产路径的副本在gems目录中找不到jquery-ui-rails [英] Copy of environments/development asset path cannot find jquery-ui-rails in gems directories

查看:125
本文介绍了环境/开发资产路径的副本在gems目录中找不到jquery-ui-rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将config/environments/development.rb复制到config/environments/ci.rb.

I copied config/environments/development.rb to config/environments/ci.rb.

当我使用RAILS_ENV = development运行时,资产搜索路径包括我的gem供应商目录,尤其是针对jquery-ui-rails的目录.但是,当我使用RAILS_ENV = ci运行时,不会.

When I run with RAILS_ENV=development, the asset search path includes my gem vendor directories, in particular for jquery-ui-rails. However, when I run with RAILS_ENV=ci it does not.

在控制台中,Rails.application.config.assets.paths通过开发评估为以下内容

From the console, Rails.application.config.assets.paths evaluates to the following with development

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,我只能得到以下信息:

but for ci I only get the following:

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"]

推荐答案

您是否已将ci环境添加到config/application.rb?

Have you added the ci environment into config/application.rb?

if defined?(Bundler)
  # If you precompile assets before deploying to production, use this line
  Bundler.require(*Rails.groups(:assets => %w(development test ci)))
  # If you want your assets lazily compiled in production, use this line
  # Bundler.require(:default, :assets, Rails.env)
end

这篇关于环境/开发资产路径的副本在gems目录中找不到jquery-ui-rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆