-1

I installed Ruby and Rails and set-up the PATH to "C:\Rails\Ruby2.3.0\bin", but when I try to run commands with rails, I get the error message:

The System cannot find the path specified.

I am able to run commands using ruby, and rails works if I use GitBash. How do I make it work on my normal command line?

5
  • We need more information. How did you install Ruby and Rails? How did you set your PATH? Commented Feb 6, 2017 at 21:40
  • Navigate in Windows Explorer to C:\Rails\Ruby2.3.0\bin. Does the directory exist? What files are there? Commented Feb 6, 2017 at 21:44
  • @theTinMan I installed ruby and rails from railsinstaller.org/en. It automatically added to user variables PATH. Since it was not working I also added the same path to Path under System variables. Still not working. Commented Feb 6, 2017 at 22:19
  • @tibsar Directory exists. Consists of many files like bundle.bat, ruby.exe, gem, sqlite3.exe, rails.bat Commented Feb 6, 2017 at 22:21
  • 1
    Have you restarted your terminal? What terminal are you using? Commented Feb 7, 2017 at 13:33

2 Answers 2

1

Had the same problem here, installed the same way. Couldn't even run rails commands on GitBash, only way was going in C:\Rails\Ruby2.3.0\binthrough cmd and typing, for example, ruby rails new projectname. The rails new projectnamewouldn't work even in these conditions.

What I did was going in the Command Prompt with Ruby and Rails and entered gem install rails (which did not work on cmd). I also did gem install bundle. Both installed successfully and that fixed all consoles for me: cmd, GitBash (wasn't working for me), Command Prompt with Ruby and Rails and even cmder works with Rails now.

Hope this helps you. Cheers.

Sign up to request clarification or add additional context in comments.

Comments

0

If it's a simple question of locating the rails executable on Windows, then on later installs that use msys64 instead of DevKit, you'll find rails at the following folder:

c:\msys64\o-rdoc

Add this to your PATH or execute from that folder.

Your path may vary on 32-bit systems or if you changed the default install folder.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.