Skip to content

Instantly share code, notes, and snippets.

@wnuqui wnuqui/gist:2717341

Created May 17, 2012
Embed
What would you like to do?
ruby's "system" call suddenly contradicts what I saw running the "rake tasks" in shell
# try running a rake task like
RAILS_ENV=test ANOTHER=imaginary rake foo:bar
# and run
rake foo:bar RAILS_ENV=test ANOTHER=imaginary
# both run right?
# now do this
ruby -e "system 'rake foo:bar RAILS_ENV=test ANOTHER=imaginary'"
# and this
ruby -e "system 'RAILS_ENV=test ANOTHER=imaginary rake foo:bar'"
# notice last one is quick to return, ignored?
# what is with ruby's system then?
# to add more load to the grey matter there then do this
ruby -e "system 'RAILS_ENV=test ANOTHER=imaginary rake foo:bar && rake foo:bar RAILS_ENV=test ANOTHER=imaginary'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.