我几乎全新编程,所以请耐心等待。我正在运行10.6.6的Macbook Pro。终端不执行Ruby文件
在"Learn to Program"教程开始有这些方向:
Save your program (yes, that's a program!) as calc.rb (the .rb is what we usually put at the end of programs written in Ruby). Now run your program by typing ruby calc.rb into your command line. It should have put a 3 on your screen. See, programming isn't so hard, now is it?
当我键入ruby calc.rb
我得到以下错误:
ruby: No such file or directory -- calc.rb (LoadError)
我在做什么错? “Calc.rb”保存在我的桌面上,如果重要的话。
你遇到了这个问题不是一个编程一个,那是因为你没有在命令行中使用的计算机的基本了解。我强烈要求学习使用PATH进行导航,并修改它,以及何时和为什么要这样做,并指定一个文件路径,无论是从驱动器根目录的绝对路径,还是从你家的相对路径`〜/`)目录或当前(`。/`)目录。这些知识将使您的编程体验更加轻松。 StackOverflow用于编程问题。 [SuperUser.com](http://superuser.com/)用于可用性问题。 – 2011-01-19 16:32:11