I've created a file ebm.rb script to add new entries to a database in rails.
The file is very long, and uses some rails models.
Can I easily execute ebm.rb in the rails console?
I tried something with load and require, but that didn't work. My ebm.rb file is located in C:\Sites\ebm and my rails project in C:\Sites\rublesql.
You can run the code in the file in the context of your rails app with
rails runner
http://guides.rubyonrails.org/command_line.html#rails-runner
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With