How to load plugins which aren’t in the folder vendor/plugins (in my
case in another rails project)
regards
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
Jean-sébastien Jney wrote:
How to load plugins which aren’t in the folder vendor/plugins (in my
case in another rails project)regards
try
environment.rb
Rails::Initializer.run do |config|
config.plugin_paths += [“#{RAILS_ROOT}/other/path/to/plugins”]
end
see freddy cheung’s blog post about it
http://www.texperts.com/2007/06/21/on-sharing-code-between-rails-apps/
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs