ããã¾ã§railsä¸ã§ã®ãããå¦çã¯script/runnerã使ã£ã¦ä»¥ä¸ã®ãããªã³ãã³ãã§å®è¡ãã¦ãã¾ããã script/runner "eval(IO.readlines('hoge.rb').join)" ã§ãããé·ãã§ãããããã£ã¨çãããæ¹æ³ã¯ãªãããªã¼ã¨æã£ã¦script/runner --helpãããããããªæ¸ãæ¹ãã§ããããã¨ã®ãã¨ã #!/usr/bin/env /path/to/script/runner Product.find(:all).each { |p| p.price *= 2 ; p.save! } shebangã«script/runnerã¾ã§ã®ãã¹ãæå®ããã¨ããã以ä¸ã®ã¹ã¯ãªãããrunnerç°å¢ã§å®è¡ãã¦ãããã¿ããã§ããããã«ããããã¨ãã°ä¸è¨ã®ãã¡ã¤ã«ãscript/product_findã¨ããã script/product_find
{{#tags}}- {{label}}
{{/tags}}