hi,
I am also using 0.9.2 gem install.
I have just recreated similar behavior with the formtastic gem. I
have added it as a gem in my extension file but it is not available in
my views as expected. Adding the config.gem line to the {RAILS_ROOT}/
config/environment.rb allows the formtastic gem to work. Must be
something in how the gem is built.
I have been able to use RedCloth gem in an extension so I know I can
add a gem to an extension file and get it to work.
--
Matt
On Nov 13, 8:56 am, Jarret Luft <
jarret.l...@gmail.com> wrote:
> Hi Brian, you may have just pointed me to my initial mistake:
>
> Initially, I had been placing the config.gem line into the my_extension.rb
> file for my extension as follows:
>
> def self.require_gems(config)
> config.gem 'mbleigh-subdomain-fu', :source => "
http://gems.github.com",
> :lib => "subdomain-fu"
> end
>
> Upon your suggestion, I added this line back in, and the site continued to
> function properly.
> Then I removed the subdomain plugin folder from vendors/plugins to see if it
> would fail again, and it did fail.
>
> Then I tried adding the config.gem line directly to the spree environment.rb
> file, and it works fine again now, using the gem instead of the plugin.
>
> Is there something wrong with my code above, that would have caused the gem
> not to work properly when initialized from within my_extension.rb?
>
> I will leave it in environment.rb for now, but as this applies only to my
> extension, I would prefer to have it in my extension code, and not in the
> base code...
>
> -Jarret.
>
>
>
> On Fri, Nov 13, 2009 at 1:23 AM, Brian Quinn <
briandqu...@gmail.com> wrote:
> > That's an interesting one, if you add back in config.gem does it stop
> > working again?
>
> > On Fri, Nov 13, 2009 at 2:16 AM, Jarret Luft <
jarret.l...@gmail.com>wrote:
>
> >> It appears I have corrected this issue, but am still not sure why it
> >> happened.
>
> >> I uninstalled the subdomain_fu gem and removed the config.gem
> >> initializer line, and opted to try the plugin instead. With the
> >> plugin installed and no other configuration changes, I can now call
> >> current_subdomain and current_domain as expected.
>
> >> Regards,
> >> -J.
>
> >> On Nov 12, 9:25 am, Jarret Luft <
jarret.l...@gmail.com> wrote:
> >> > Hi Brian,
> >> > Thanks for the reply.
>
> >> > My /etc/hosts is set up to point 127.0.0.1 to mysite.local (the tld),
> >> > some_sub1.mysite.local, some_sub2.mysite.local, etc...
> >> > I have configured the tld_sizes parameter as 1 in dev, test and prod.
>
> >> > Unfortunately, because I can't access the current_subdomain from within
> >> a
> >> > controller, I can't tell what it is actually returning as the subdomain
> >> > piece of the url, vs the tld piece.
> >> > I can only say that it is redirecting properly because when i
> >> providehttp://mysite.local:3000asthe url, i am redirected to spree's