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!

1
  • 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. Commented Mar 12, 2012 at 16:56

1 Answer 1

16

Try this:

load "#{Rails.root}/config/initializers/your_file.rb"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.