Neal Koss Neal Koss - 1 month ago 16
Ruby Question

Error installing Rails on Windows 10

I am using the railsinstaller-3.2.0.exe that I got from the railsinstaller.org site. Although the site says "Rails 4.2", when you download, the filename is as noted above.

The installation seems to proceed normally, but at the end, it shows the Environment Configuration and it is clear that it cannot find the rails.bat file to run rails. The directory is definitely in my path, so is there some other reason why Windows cannot find the file?

Answer

What you're seeing is a complaint about a different path (on some other developer's machine), not your System Path.

RailsInstaller seems to include an unresolved (and continuing) problem with their builds. If you look in your .bat files, you'll find the following lines, which indicate that RailsInstaller is using a hardcoded path that refers to the machine of a specific RailsInstaller developer:

@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"

Any instance of the previous code should be replaced with the following:

@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
ECHO.This version of Ruby has not been built with support for Windows 95/98/Me.
GOTO :EOF
:WinNT
@"%~dp0ruby.exe" "%~dpn0" %*

If all else fails and you just don't want to deal with it, the RailsInstaller web page includes multiple versions, so you can just go back and use an earlier version (e.g. use the version with Ruby 2.1.8 and Rails 4.2).

All this having been said, you may find cause to revisit your stance against using virtualization at some point. Many Ruby/Rails libraries are compiled for *nix, and testing against Windows is limited or non-existent, which means you're likely to run into issues sooner or later. It might be wise to at least take a look at Vagrant, etc. now instead of having to change dev environments in the middle of a project.

Comments