Hello I installed cygwin on Windows XP so I can use Unix command in Console2. I also installed Ruby on Rails without much of problem. Then I tried to run the 'ruby /script/server' command, and I got the following error:
您好我在Windows XP上安装了cygwin,因此我可以在Console2中使用Unix命令。我还安装了Ruby on Rails而没有太多问题。然后我尝试运行'ruby / script / server'命令,我收到以下错误:
$ ruby /script/server
c:\ruby\bin\ruby.exe: No such file or directory -- /script/server (LoadError)
In order to access any files or drives on Cygwin, I know I have to prepend the path with \cygdrive. So that must be causing the problem. However I don't know how to make Rails aware that \cygdrive\ has to be prepended in front.
为了访问Cygwin上的任何文件或驱动器,我知道我必须在\ cygdrive前面添加路径。所以这必然导致问题。但是我不知道如何让Rails意识到\ cygdrive \必须先于前面。
Also, if there is a better way to do Rails development on Windows environment, please let me know. I've been riding Rails on OSX, and it's the first time on Windows. So I'm used to the unix commands and I'd like to keep using them on Windows as well.
另外,如果有更好的方法在Windows环境中进行Rails开发,请告诉我。我一直在OSX上使用Rails,这是Windows上的第一次。所以我习惯了unix命令,我也想继续在Windows上使用它们。
2 个解决方案
#1
The command should be:
命令应该是:
ruby script/server
The leading '/' will look for the file in the root directory instead of your current directory.
前导'/'将在根目录中查找文件而不是当前目录。
#2
This doesn't answer your question about Cygwin but more your last part about other ways to do Rails on Windows. I understand you wanting to use the command line options, although there is some pretty good IDE support available on Windows. I just recently switched to Netbeans 6.7 with the built in Ruby bundle. I have to say it works very well so far. I had been using Aptana but I wouldn't recommend it (way to buggy). But I understand if you aren't keen on using an IDE (especially if that is what you are used to on Mac) - it worked for me but I came from Java so I actually like having my security blanket (er..I mean IDE).
这不能回答你关于Cygwin的问题,但更多关于你在Windows上进行Rails的其他方法的最后一部分。我知道你想使用命令行选项,虽然在Windows上有一些非常好的IDE支持。我刚刚使用内置的Ruby软件包切换到Netbeans 6.7。我不得不说到目前为止它的效果非常好。我一直在使用Aptana,但我不推荐它(通过越野车的方式)。但我明白,如果你不热衷于使用IDE(特别是如果你习惯在Mac上) - 它对我有用,但我来自Java,所以我真的喜欢我的安全毯(呃......我的意思是IDE)。
#1
The command should be:
命令应该是:
ruby script/server
The leading '/' will look for the file in the root directory instead of your current directory.
前导'/'将在根目录中查找文件而不是当前目录。
#2
This doesn't answer your question about Cygwin but more your last part about other ways to do Rails on Windows. I understand you wanting to use the command line options, although there is some pretty good IDE support available on Windows. I just recently switched to Netbeans 6.7 with the built in Ruby bundle. I have to say it works very well so far. I had been using Aptana but I wouldn't recommend it (way to buggy). But I understand if you aren't keen on using an IDE (especially if that is what you are used to on Mac) - it worked for me but I came from Java so I actually like having my security blanket (er..I mean IDE).
这不能回答你关于Cygwin的问题,但更多关于你在Windows上进行Rails的其他方法的最后一部分。我知道你想使用命令行选项,虽然在Windows上有一些非常好的IDE支持。我刚刚使用内置的Ruby软件包切换到Netbeans 6.7。我不得不说到目前为止它的效果非常好。我一直在使用Aptana,但我不推荐它(通过越野车的方式)。但我明白,如果你不热衷于使用IDE(特别是如果你习惯在Mac上) - 它对我有用,但我来自Java,所以我真的喜欢我的安全毯(呃......我的意思是IDE)。