Require file in rails

I have a file called dbcon.rb that I put in the config directory.

I want to call it from rake, and I was using
require ‘config/dbcon.rb’

This was allowing me to access the classes in this file.

Somehow, the require command cannot find this file anymore. Is there a
convention in rails? How do I use require from different parts of my


Kaushik katari wrote:

my application?
You could move it to the lib directory, or write
require “#{RAILS_ROOT}/config/dbcon.rb”

Rails Wheels - Find Plugins, List & Sell Plugins -

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs