error running npm to install ios-sim

Executing the following command...

~$ sudo npm install -g ios-sim

Yields...

\
> ios-sim@3.1.1 preinstall /usr/local/lib/node_modules/ios-sim
> rake build

/Users/jlivermore/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rake (>= 0) amongst [] (Gem::LoadError)
    from /Users/jlivermore/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from /Users/jlivermore/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
    from /Users/jlivermore/.rvm/gems/ruby-1.9.3-p327@global/bin/rake:18:in `<main>'
    from /Users/jlivermore/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/jlivermore/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "ios-sim"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE

npm ERR! ios-sim@3.1.1 preinstall: `rake build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ios-sim@3.1.1 preinstall script 'rake build'.
npm ERR! This is most likely a problem with the ios-sim package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rake build
npm ERR! You can get their info via:
npm ERR!     npm owner ls ios-sim
npm ERR! There is likely additional logging output above.

As suggested in other posts, I have the following...

~$ which rake
/Users/jlivermore/.rvm/gems/ruby-1.9.3-p327@global/bin/rake

~$ rake --version
rake, version 10.0.3

~$ gem list | grep rake
rake (10.0.3)

Can anyone see what the issue is?

Please make sure that xcode is installed then retry. I assumed my brand new mac would have it on there by default but it doesnt.