This project is archived and is in readonly mode.
[PATCH] config.gem_paths
Reported by dreamcat4 (at gmail) | June 24th, 2009 @ 11:33 PM | in 3.0.2
This is a patch to allow configurable search paths for gems in addition to the vendor/gems directory. However this is rather tricky to add because there seems to be 3 main times when rails will want to load up and work with vendor/gems.
1) the Rake tasks to freeze / unfreeze gems
2) the Rails startup code in the very beginning, will try to load
once the gems
3) the time after environment.rb and after the config,gem
in run initializer do |config|.
So far I have succeeded in doing muliple paths for 3), but not 1) and 2).
Its basically an equivalent of config.plugin_paths for plugins
(which is already in rails).
I can put in my environment.rb a configuration line like this:
config.gem_paths = ["#{PLUGIN_PATH}/vendor/gems",
"gem_path2", "gem_path3"]
However this setting the load paths is happen too late in the environment.rb file, for the rake tasks. The problem is that these rake tasks and early initialization code don't read the environment.rb file so am finding the gems management code a little too complex to be able to accomodate this one.
There are other plans to re-think the gem code (ticket #1721). This patch is to work right now in the rails 2.3 gems code. Ideally i'd like to convert my patch to a separate file (monkey-patch) that could be installed in the app's config directory, instead of touching the rails source files.
This patch wont interfere the operation of any standard rails app which stores its gems in vendor/gems. This default load path is preserved. For a multi-path app, it may generate some warnings / error for the rake tasks. Runtime behaviour should be fine but no tests.
Comments and changes to this ticket
-
Michael Koziarski June 26th, 2009 @ 06:07 AM
- Assigned user set to Matt Jones
- Milestone changed from 2.x to 2.3.4
-
Yehuda Katz (wycats) July 2nd, 2009 @ 07:10 PM
- State changed from new to hold
- Tag changed from 2-3-stable, config, configuration, gem, gem.config, gems, load_paths, patch, vendor to initializer, paths, rubygems
- Milestone cleared.
We're going to be reworking the way gems work for Rails 3 that will make this quite trivial to implement, so we're putting it on hold for now.
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to High
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 1721 Unify approach to gem dependencies Some of you may be interested in this patch (ticket #2834...