How do I run a Ruby file in a Rails environment?

前端 未结 4 1349
名媛妹妹
名媛妹妹 2020-12-12 18:22

I want to run a Ruby file in the context of a Rails environment. rails runner almost does what I want to do, but I\'d like to just give it the file name and arguments. I\'m

4条回答
  •  粉色の甜心
    2020-12-12 19:12

    The simplest way is with rails runner because you don't need to modify your script.

    http://guides.rubyonrails.org/command_line.html#rails-runner

    Just say rails runner script.rb

提交回复
热议问题