Pass ruby script file to rails console

后端 未结 7 1069
醉梦人生
醉梦人生 2021-01-29 20:51

Is there a way to pass ruby file, foo.rb to rails console. Expected results would be after console starts rails environment to run file.

Or any other way which

7条回答
  •  失恋的感觉
    2021-01-29 21:34

    Actually, the simplest way is to run it with load inside the rails console

     load './path/to/foo.rb'
    

提交回复
热议问题