ruby - How do I start redis as a rakefile task -
i trying create rakefile runs both redis , irb. have figured out how run irb (the first task runs), when try run redis task see error:
rake aborted! wrong number of arguments
exactly wrong? code below:
task :default require 'irb' irb.start end task :init require 'redis' exec {'redis-server'} end
command use run code:
bundle exec rake (or rake :init, depending on 1 want run)
you receiving argument error because exec
expects string argument, , sending block. exec
not block , wants string.
use exec "redis-server"
execute command correctly.
hopefully result looking for. not sure why requiring redis @ since aren't using gem, executing command. behavior of task no different running redis-server
on command line.
Comments
Post a Comment