8

I've got an initialization file config/initializers/linkedin.rb that sets up the Linkedin gem so that my app can connect to the LinkedIn service and run queries. I'm now testing out some new features and I want to use the console for this. My problem - asside from being a newb and not understanding the console very well yet - is that I can't access the variables that are initialized in config/initializers/linkedin.rb.

Any ideas on how to use the application initializers from within the console so that I don't have to run this by hand every time?

Thanks!

spinlock
  • 3,737
  • 4
  • 35
  • 46
  • Sorry, this looks like a BUOK (Bad User On Keyboard) error. I was typing `Linkedin` instead of `LinkedIn`. When I get the capitalization right, I see that the LinkedIn gem is initialized. So, it looks like `config/initializers/*.rb` are being run when you drop down into the console. – spinlock Mar 12 '12 at 16:56

1 Answers1

16

Try this:

load "#{Rails.root}/config/initializers/your_file.rb"
ecoologic
  • 10,202
  • 3
  • 62
  • 66