Forum: Ruby on Rails Help needed in rails project

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Manisha T. (Guest)
on 2009-02-09 17:20
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.
Juan José Vidal (Guest)
on 2009-02-09 17:24
(Received via mailing list)
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 T. escribió:
Manisha T. (Guest)
on 2009-02-09 17:33
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 T. escribió:
Juan José Vidal (Guest)
on 2009-02-09 17:36
(Received via mailing list)
Obviously.

Manisha T. escribió:
Manisha T. (Guest)
on 2009-02-09 17:47
still its not working. :((


Juan José Vidal wrote:
> Obviously.
>
> Manisha T. escribió:
Juan José Vidal (Guest)
on 2009-02-09 17:48
(Received via mailing list)
You must put your path in this line...

Manisha T. escribió:
Manisha T. (Guest)
on 2009-02-09 17:53
ok I am trying again

Juan José Vidal wrote:
> You must put your path in this line...
>
> Manisha T. escribió:
Manisha T. (Guest)
on 2009-02-09 18:02
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 T. wrote:
> ok I am trying again
>
> Juan José Vidal wrote:
>> You must put your path in this line...
>>
>> Manisha T. escribió:
Juan José Vidal (Guest)
on 2009-02-09 18:10
(Received via mailing list)
Manisha T. (Guest)
on 2009-02-09 18:25
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...
> http://www.depixelate.com/2007/12/13/actionwebserv...
> http://railsguts.com/initialization.html
> http://www.benjaminbooth.com/tableorbooth/2006/11/...
>
>
> Manisha T. escribió:
This topic is locked and can not be replied to.