Skip to content

Instantly share code, notes, and snippets.

@wnuqui
Created May 17, 2012 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wnuqui/2717341 to your computer and use it in GitHub Desktop.
Save wnuqui/2717341 to your computer and use it in GitHub Desktop.
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