load plugins from an external folder

How to load plugins which aren't in the folder vendor/plugins (in my case in another rails project)

regards

i did it in that way, adding this to environment.rb :

plug_dir = Dir.new("#{RAILS_ROOT}/../other_rails_dir/vendor/plugins") plug_dir.entries.each do |plug|   %w(. ..).include?(plug) && next   path = File.join(plug_dir.path, plug)   if(File.directory?(path))     $: << File.join(path, 'lib')     require File.join(path, 'init')   end end

someone has a simplier solution?

not sure about plugins.. but gems can be accessed using following:

ENV['GEM_HOME']='/usr/lib/ruby/gems/1.8' ENV['GEM_PATH']='/home/ckh/gems' in dispatch.fcgi

ENV['GEM_HOME'] is default gem path and second option is for custom one..

you can try same for plugins.. but not 100% sure

Ajit

see freddy cheung's blog post about it

钛刻专家——官网

damn you matthew, pimping my own blog posts before I get round to it ! :slight_smile:

Fred