Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows cannot detect rails installation #72

Open
nitalchandel opened this issue Feb 18, 2016 · 16 comments
Open

Windows cannot detect rails installation #72

nitalchandel opened this issue Feb 18, 2016 · 16 comments

Comments

@nitalchandel
Copy link

I installed Rails from http://railsinstaller.org/en on my Windows 7 desktop and the installation went fine. However, after installation when I do:

C:\Sites>rails --version
The system cannot find the path specified.

C:\Sites>ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]

C:\Sites>gem -v
2.4.5.1

C:\Sites>git --version
git version 1.9.4.msysgit.2


Not sure what I am missing here because the installation worked for me in the past.

@nitalchandel
Copy link
Author

Found the problem. It looks like the distributable (railsinstaller-3.2.0.exe which uses Ruby 2.2) provided on rails installer site (http://railsinstaller.org/en) is having some problem. When I picked the older version (railsinstaller-3.1.1.exe which uses Ruby 2.1) it was able to pick the rails version without any problem.

C:\>rails --version
Rails 4.2.5.1

C:\>ruby --version
ruby 2.1.8p440 (2015-12-16 revision 53160) [i386-mingw32]

Please note that the ruby version is downgraded from 2.2 to 2.1 here.

@ghost
Copy link

ghost commented Feb 19, 2016

I experienced the same problem after installing (railsinstaller-3.2.0.exe which uses Ruby 2.2) and I found out that the content of rails.bat which resides in 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" %*

So C:\Users\emachnic\GitRepos\railsinstaller-windows\stage\Ruby2.2.0\bin\ruby.exe has to be C:\RailsInstaller\Ruby2.2.0\bin\ruby.exe.

@cajic
Copy link

cajic commented Feb 24, 2016

@DerJuggernawt

Solved the exact same problem I had!

@hermiti
Copy link

hermiti commented Feb 26, 2016

I had the same problem. Not to be captain obvious but I replaced:

"C:\Users\emachnic\GitRepos\railsinstaller-windows\stage"

With my install directory:

"C:\RailsInstaller"

For everything in the "C:\RailsInstaller\Ruby2.2.0\bin" folder, which was found in 26 places over 13 files.

@caswda63
Copy link

OK!
So can someone please tell me where RailsInstaller got that path from?
Makes for a doubly frustrated noob too RubyonRails!

@ivopashov
Copy link

Same problem here on Win 10. Some bat files were correct other not. So resolution for me was:

Replace
:WinNT @"C:\Users\emachnic\GitRepos\railsinstaller-windows\stage\Ruby2.2.0\bin\ruby.exe" "%~dpn0" %*

With
:WinNT @"%~dp0ruby.exe" "%~dpn0" %*

After that rails -v started to show version

@sPaCeMoNk3yIam
Copy link

+1

@pcurwin
Copy link

pcurwin commented Jul 19, 2016

I just installed it today and the problem still persists, but thankful for this thread to point out the fix.

@williantenfen
Copy link

Still got same problem today.. Fixed it just like @DerJuggernawt did ....

@haagamble
Copy link

Could somebody please explain in more detail how to fix it. Thanks.

@msharil
Copy link

msharil commented Oct 28, 2016

Try this steps:

gem sources -a http://rubygems.org//

gem install rails

@ashmaroli
Copy link

there are a bunch of old binaries distributed with this installer. so simply run the following:

gem update --system --no-document && gem update --no-document

@pelx
Copy link

pelx commented Mar 16, 2017

The problem has not been fixed. Hiccups like this will eventually kill the Rails.

@eduavencama
Copy link

eduavencama commented Apr 10, 2017

I copied this from jayantbh:

I opened all the files under C:\RailsInstaller\Ruby2.2.0\bin in Sublime Text, and replaced with Ctrl+Shift+F,
This
@"C:\Users\emachnic\GitRepos\railsinstaller-windows\stage\Ruby2.2.0\bin\ruby.exe"
with this
@"%~dp0ruby.exe"
across all files that had a match.

This save your time also you must pay attention to the folder, in my specific case the version of ruby is 2.3.0, so you must the change the path for:
@"C:\Users\emachnic\GitRepos\railsinstaller-windows\stage\**Ruby2.3.0**\bin\ruby.exe"

En español:

Abran Sublime y arrastren el folder bin de la instalación de rails (puede estar en C:\RailsInstaller\Ruby2.2.0\bin), luego presionan la combinación Ctrl+Shift+F para poder buscar y reemplazar en todos los archivos .bat al tiempo.
Find:
@"C:\Users\emachnic\GitRepos\railsinstaller-windows\stage\Ruby2.2.0\bin\ruby.exe"
Replace:
@"%~dp0ruby.exe"

Reemplazan, guardan y listo.

Credits: jayantbh in "#73"

@davidalejandroaguilar
Copy link

Just installed, issue still happening.

@emachnic
Copy link
Contributor

Please try with the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests