It is about rails2 I have a gem that I install as a plugin, I want in development environment use it from vendor/plugins folder and if it is installed in system to use the systems gem But if I use config.gem in environment.rb it raises an error about missing gem even if it is present in vendor/plugins -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Bryan Crossland
2011-Apr-16 03:58 UTC
Re: Plugin or Gem reuirement, if gem is not installed
Sent from my iPhone On Apr 15, 2011, at 9:28 AM, Vitaliy Yanchuk <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> It is about rails2 > > I have a gem that I install as a plugin, I want in development > environment use it from vendor/plugins folder and if it is installed in > system to use the systems gem > > But if I use config.gem in environment.rb it raises an error about > missing gem even if it is present in vendor/plugins >This is because config.gem is looking for a gem. It won''t fall back and check for a plugin if it fails to find a gem. I think your best bet is to use a require statement. It''ll check for the plugin and use that if it finds it. If not it will look for the gem. Someone please correct me if I''m wrong. I''ve not actually done this since I''ve only had one or the other in my apps. B. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Apr 15, 10:28 am, Vitaliy Yanchuk <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> It is about rails2 > > I have a gem that I install as a plugin, I want in development > environment use it from vendor/plugins folder and if it is installed in > system to use the systems gem > > But if I use config.gem in environment.rb it raises an error about > missing gem even if it is present in vendor/plugins >Plugins can live in gems, but there''s not an equivalent for the other direction. What you''ll want to do is to add the config.gem line and then do: rake gems:unpack GEM=whatever_the_gem_name_is which will unpack the gem to vendor/gems along with the needed gemspec to get things working. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.