Pergunta

I know that my question is not a new one but I will be more specific hopefully to get a specific answer as well.

I am using:

  • Ubuntu 11.10 --> (First time in my life though a virtual machine on windows vista)
  • Tried to install rvm and Ruby --> (Went successfully but honestly i don't know were they are :D)
  • Passed through vim tutorial
  • Tried the Hello_World exercise as follows:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:! mkdir rubymonk
cd rubymonk
:e hello_world.rb
-------------------------
vim (insert mode)
puts "Hello World"
-------------------------
:wq

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • Back to the Terminal
  • typing: ruby hello_world.rb
  • Got the usual error (ruby: No such file or directory -- hello_world.rb (LoadError)

Hopefully I can get an answer from you guys.

Foi útil?

Solução

It looks like in vim you created the directory rubymonk, and then cd into it. But that was inside vim, so you need to do the same in your terminal:

cd rubymonk
ruby hello_world.rb
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top