Help needed in rails project

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.

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ó:

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ó:

still its not working. :((

Juan José Vidal wrote:

Obviously.

Manisha T. escribió:

Obviously.

Manisha T. escribió:

You must put your path in this line…

Manisha T. escribió:

ok I am trying again

Juan José Vidal wrote:

You must put your path in this line…

Manisha T. 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 . :frowning:
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ó:

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 T. escribió:

thanks a lot , it works now :slight_smile:
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 T. escribió: