1

我已经为 Windows 下载了最新的 Rails Installer .exe。我已经运行了它,一切似乎都成功了,检查时我得到以下输出:

$ ruby -v

ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]

$ gem install rails

Successfully installed rails-4.2.5.1

Parsing documentation for rails-4.2.5.1

Done installing documentation for rails after 1 seconds

1 gem installed
$ rails new app
The system cannot find the path specified

所以好像没用??为什么会这样,我能做些什么来补救它?

4

1 回答 1

3

我发现 rails.bat 的内容在C:\RailsInstaller\Ruby2.2.0\bin has the wrong path.

@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"C:\Users\emachnic\GitRepos\railsinstaller-windows\stage\Ruby2.2.0\bin\ruby.exe" "C:/Users/emachnic/GitRepos/railsinstaller-windows/stage/Ruby2.2.0/bin/rails" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"C:\Users\emachnic\GitRepos\railsinstaller-windows\stage\Ruby2.2.0\bin\ruby.exe" "%~dpn0" %*

所以C:\Users\emachnic\GitRepos\railsinstaller-windows\stage\Ruby2.2.0\bin\ruby.exe必须C:\RailsInstaller\Ruby2.2.0\bin\ruby.exe

于 2016-02-27T17:15:43.010 回答