cubeb
cubeb

Reputation: 457

Rails command not working on Windows command line

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?

Upvotes: -1

Views: 2101

Answers (2)

Greg May
Greg May

Reputation: 144

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.

Upvotes: 0

Klaux
Klaux

Reputation: 11

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.

Upvotes: 1

Related Questions