What should I require to use rails application in my script

Hi,

I have my rails application.
It works in script/console.
How can I make it work in my own ruby script?
What should I require?

Thanks.

Sam

Sam K. wrote:

Hi,

I have my rails application.
It works in script/console.
How can I make it work in my own ruby script?
What should I require?

Thanks.

Sam

config/environment.rb

I think

Sam K. wrote:

Hi,

I have my rails application.
It works in script/console.
How can I make it work in my own ruby script?
What should I require?

Thanks.

Sam
I think the correct way would be to run your script as follows:

ruby script/runner ‘load “<path_to_your_script>/your_script.rb”’

Hope that helps,

Dave.

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