In Rails 3b4 my ruby files in the lib directory of my application were automaticaly loaded/required. In Rails 3rc1, there are not anymore. Is this normal? Where is the commit that changed this? What is the best prefered way to load the files in "lib"? Thanks for your answers. Nicolas. -- 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.
stephenjamesmurdoch
2010-Jul-27 08:07 UTC
Re: Ruby on Rails 3 RC and files in "lib" directory
sam problem here :( anyone know? I get: uninitialized constant ApplicationController::Authentication Obviously I could just move the methods from my lib/authentication.rb file into application_controller.rb but I''d prefer to see if there''s another way first.. On Jul 27, 9:03 am, Nicolas Blanco <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> In Rails 3b4 my ruby files in the lib directory of my application were > automaticaly loaded/required. > > In Rails 3rc1, there are not anymore. Is this normal? > > Where is the commit that changed this? > What is the best prefered way to load the files in "lib"? > > Thanks for your answers. > > Nicolas. > -- > Posted viahttp://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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Steve Murdoch wrote:> sam problem here :( > > anyone know? > > I get: > > uninitialized constant ApplicationController::Authentication > > Obviously I could just move the methods from my lib/authentication.rb > file into application_controller.rb but I''d prefer to see if there''s > another way first..Of course it''s still possible to require manually files in "lib" but wanna know if that''s a feature, not a bug :). -- 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.
stephenjamesmurdoch
2010-Jul-27 09:59 UTC
Re: Ruby on Rails 3 RC and files in "lib" directory
Hi Nicolas, i think I''ve fixed the problem.... add the following to your application.rb file: # Custom directories with classes and modules you want to be autoloadable. config.autoload_paths += %W(#{config.root}/lib) This code is generated when you create a brand new rails3rc app but not when you create a rails3b4 one... Also, in your rakefile, change: Rails::Application.load_tasks to YourAppName::Application.load_tasks I could be wrong but I think it''s fixed the problem for me.... Cheers Steve On Jul 27, 9:12 am, Nicolas Blanco <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Steve Murdoch wrote: > > sam problem here :( > > > anyone know? > > > I get: > > > uninitialized constant ApplicationController::Authentication > > > Obviously I could just move the methods from my lib/authentication.rb > > file into application_controller.rb but I''d prefer to see if there''s > > another way first.. > > Of course it''s still possible to require manually files in "lib" but > wanna know if that''s a feature, not a bug :). > -- > Posted viahttp://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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, Ading config.autoload_paths += %W(#{config.root}/lib) to my application file solved it :) Thank you so much On Jul 27, 5:59 am, stephenjamesmurdoch <stephenjamesmurd...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Nicolas, i think I''ve fixed the problem.... > > add the following to your application.rb file: > > # Custom directories with classes and modules you want to be > autoloadable. > config.autoload_paths += %W(#{config.root}/lib) > > This code is generated when you create a brand new rails3rc app but > not when you create a rails3b4 one... > > Also, in your rakefile, change: > > Rails::Application.load_tasks > to > YourAppName::Application.load_tasks > > I could be wrong but I think it''s fixed the problem for me.... > > Cheers > Steve > On Jul 27, 9:12 am, Nicolas Blanco <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > > > > Steve Murdoch wrote: > > > sam problem here :( > > > > anyone know? > > > > I get: > > > > uninitialized constant ApplicationController::Authentication > > > > Obviously I could just move the methods from my lib/authentication.rb > > > file into application_controller.rb but I''d prefer to see if there''s > > > another way first.. > > > Of course it''s still possible to require manually files in "lib" but > > wanna know if that''s a feature, not a bug :). > > -- > > Posted viahttp://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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Seemingly Similar Threads
- Bit of a issue with creating a new app and running it
- libxml-ruby: How to handle XML::Parser::ParseError?
- Problem loading YAML files and using pluralize method in Rails3rc
- Couldn't reload a module when it's changed. Tried :require_dependency, :watchable_dirs, :unloadable
- dispatch.fcgi hanging after lighttpd shutdown