Re: [Rails] Plugin or Gem reuirement, if gem is not installed
Sent from my iPhone
On Apr 15, 2011, at 9:28 AM, Vitaliy Yanchuk <lists@ruby-forum.com> 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@googlegroups.com.
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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home