Hi friends, I need to create some additional ruby files for some other functions inside a rails project. So I created another folder and put those files inside it.In this case one file needs to call the classes in other files, so I used require ''filename'' My files run well when I put them in a Ruby project. But the same codes do not work when I put them inside a folder in a Rails Project. The problem is with "require" keyword.Error is `require'': no such file to load --filename (LoadError) I cannot understand why this happens.Can anyone provide some help in this regards? I will be really thankful. -- 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 -~----------~----~----~----~------~----~------~--~---
See this line in your config/environment.rb # Add additional load paths for your own custom dirs # config.load_paths += %W( #{RAILS_ROOT}/extras ) Manisha Tripathy escribió:> Hi friends, > > I need to create some additional ruby files for some other functions > inside a rails project. So I created another folder and put those files > inside it.In this case one file needs to call the classes in other > files, so I used > require ''filename'' > > My files run well when I put them in a Ruby project. But the same codes > do not work when I put them inside a folder in a Rails Project. > The problem is with "require" keyword.Error is > > `require'': no such file to load --filename (LoadError) > > I cannot understand why this happens.Can anyone provide some help in > this regards? I will be really thankful. >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
yes, do I need to uncomment it? Juan José Vidal wrote:> See this line in your config/environment.rb > > # Add additional load paths for your own custom dirs > # config.load_paths += %W( #{RAILS_ROOT}/extras ) > > > Manisha Tripathy escribió:-- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Obviously. Manisha Tripathy escribió:> yes, do I need to uncomment it? > > > Juan José Vidal wrote: > >> See this line in your config/environment.rb >> >> # Add additional load paths for your own custom dirs >> # config.load_paths += %W( #{RAILS_ROOT}/extras ) >> >> >> Manisha Tripathy escribió: >> > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
still its not working. :(( Juan José Vidal wrote:> Obviously. > > Manisha Tripathy escribió:-- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You must put your path in this line... Manisha Tripathy escribió:> still its not working. :(( > > > Juan José Vidal wrote: > >> Obviously. >> >> Manisha Tripathy escribió: >> > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ok I am trying again Juan José Vidal wrote:> You must put your path in this line... > > Manisha Tripathy escribió:-- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
No its not working yet, can you please give an example how this line should be? Dont mind, I am not very competent, just learning . :( so may be missing something Manisha Tripathy wrote:> ok I am trying again > > Juan José Vidal wrote: >> You must put your path in this line... >> >> Manisha Tripathy escribió:-- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can see some examples in: http://www.strictlyuntyped.com/2008/06/rails-where-to-put-other-files.html http://www.depixelate.com/2007/12/13/actionwebservice-with-rails-2-0 http://railsguts.com/initialization.html http://www.benjaminbooth.com/tableorbooth/2006/11/rails_and_load_.html Manisha Tripathy escribió:> No its not working yet, can you please give an example how this line > should be? > Dont mind, I am not very competent, just learning . :( > so may be missing something > > Manisha Tripathy wrote: > >> ok I am trying again >> >> Juan José Vidal wrote: >> >>> You must put your path in this line... >>> >>> Manisha Tripathy escribió: >>> > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks a lot , it works now :) I just needed to add the folder name also in the require '''' line thaks a lot for the help Juan José Vidal wrote:> You can see some examples in: > > http://www.strictlyuntyped.com/2008/06/rails-where-to-put-other-files.html > http://www.depixelate.com/2007/12/13/actionwebservice-with-rails-2-0 > http://railsguts.com/initialization.html > http://www.benjaminbooth.com/tableorbooth/2006/11/rails_and_load_.html > > > Manisha Tripathy escribió:-- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---