[Rails] Re: Ruby on Rails 3 RC and files in "lib" directory

2010-07-27 Thread Eric Yen
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
 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  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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Ruby on Rails 3 RC and files in "lib" directory

2010-07-27 Thread stephenjamesmurdoch
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  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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Ruby on Rails 3 RC and files in "lib" directory

2010-07-27 Thread Nicolas Blanco
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Ruby on Rails 3 RC and files in "lib" directory

2010-07-27 Thread stephenjamesmurdoch
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  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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.