I''m using the login_system gem which works fine on my dev. environment (RadRails / webbrick). Also my hosting company (A2) installed the same GEM. But when I try to login on the production server, I get: NoMethodError in AccountController#login undefined method `redirect_back_or_default'' for #<AccountController:0x2a96ffa088> Does there need to be a require somewhere? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Brett Kelts - KeltexIS.com wrote:> I''m using the login_system gem which works fine on my dev. environment > (RadRails / webbrick). Also my hosting company (A2) installed the same > GEM. But when I try to login on the production server, I get: > > NoMethodError in AccountController#login > > undefined method `redirect_back_or_default'' for > #<AccountController:0x2a96ffa088> > > Does there need to be a require somewhere?RubyGems have their own ''require_gem'' that is like ''require'' but for gems. You can put that in your environment.rb or environments/production.rb, depending on if you want it in all environments or just production. require_gem ''login_system'' I''ve never used the login_system gem so I don''t know if there are other dependencies that might be screwing you up. It may be that A2 messed up the gem installation somehow. -- Josh Susser http://blog.hasmanythrough.com -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Thanks for your feedback. I added require_gem ''login_generator'' to the environment.rb, but no dice. How would I determine what other dependencies are required? When the gem was installed in my environment it created the file login_system.rb in my lib directory. This defines a module LoginSystem which includes the method redirect_back_or_default. Does this somehow need to be included? Still don''t understand why it complains in production mode but is fine in dev. mode. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
You have to "include" the LoginSystem in ApplicationController: class ApplicationController < ActionController::Base include LoginSystem .. end Vish On 9/25/06, Brett Kelts - KeltexIS.com <bkelts-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Thanks for your feedback. > > I added require_gem ''login_generator'' to the environment.rb, but no > dice. How would I determine what other dependencies are required? > > When the gem was installed in my environment it created the file > login_system.rb in my lib directory. This defines a module LoginSystem > which includes the method redirect_back_or_default. > > Does this somehow need to be included? Still don''t understand why it > complains in production mode but is fine in dev. mode. > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On Sep 25, 2006, at 7:51 AM, Josh Susser wrote:> > Brett Kelts - KeltexIS.com wrote: >> I''m using the login_system gem which works fine on my dev. >> environment >> (RadRails / webbrick). Also my hosting company (A2) installed the >> same >> GEM. But when I try to login on the production server, I get: >> >> NoMethodError in AccountController#login >> >> undefined method `redirect_back_or_default'' for >> #<AccountController:0x2a96ffa088> >> >> Does there need to be a require somewhere? > > RubyGems have their own ''require_gem'' that is like ''require'' but for > gems. You can put that in your environment.rb or > environments/production.rb, depending on if you want it in all > environments or just production. > > require_gem ''login_system'' > > I''ve never used the login_system gem so I don''t know if there are > other > dependencies that might be screwing you up. It may be that A2 > messed up > the gem installation somehow. > > -- > Josh Susser > http://blog.hasmanythrough.comNo, require_gem is deprecated and should not be used unless you need to require a specific version of a gem. It will be removed in subsequent rubygems releases. Don''t use it because it is misleading and doesn''t really do what it seems like it should do. TO require an installed gem you only need to do this: require ''rubygems'' require ''gemname'' And rails already requires rubygems unless you have rails frozen in vendor. -Ezra --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
I just wanted to give everybody an update. I was completely frustrated with this gem. The hosting company (A2) gave me their response: "Unfortunately, it is beyond the scope of our support to debug applications/code for customers" Anyway, I cancelled my account with them and moved over to DreamHost. Followed their very through Wiki instructions and it now works perfectly. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
nice, i suppose on top of this you could create a file in your /config/initializers/ directory to load all the gems your app needs; making things a little more neat. haven''t tried myself but should be possible rather than sticking it into your environment.rb file all the time -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---