Pass ruby script file to rails console

后端 未结 7 1066
醉梦人生
醉梦人生 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:28

    script/console --irb=pry < test.rb > test.log
    

    simple, dirty, and block the process at the end, but it does the job exactly like I wanted.

提交回复
热议问题