Copy of environments/development asset path cannot find jquery-ui-rails in gems directories

房东的猫 提交于 2019-12-10 13:13:46

问题


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

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.

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

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

回答1:


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



回答2:


I think @mccannf has the right answer but if it isn't the problem, have you added the jquery-ui-rails gem to the the ci group into Gemfile?



来源:https://stackoverflow.com/questions/12963106/copy-of-environments-development-asset-path-cannot-find-jquery-ui-rails-in-gems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!