简体   繁体   中英

Rails not detecting in windows 10 command prompt

I tried rails -v but I am getting

'rails' is not recognized as an internal or external command,operable program or batch file.

I have done gem install rails --no-document and it installed Rails 5.0.1 but rails -v not working

I have set the environment variable to C:\\RailsInstaller\\Ruby2.3.0\\bin\\rails.bat

I have followed this guide http://installfest.railsbridge.org/installfest/windows

Thanks.

From my understanding, PATHEXT is missing .BAT from it. This is the environment variable responsible for knowing files to be executed without extensions .

To confirm, please do SET PATHEXT on a new command prompt and see the output, the result should be a semi-colon separated values that include .EXE, .BAT, .COM and perhaps .RB

If PATHEXT is empty or do not contain .BAT in it, that could explain why is not working.

This usually happens when windows versions do not match with that of rails. To solve, uninstall RubyInstaller and reboot the system and verify. I f variables are not restored, reinstall ruby. this should fix your problem.

Source: Ruby Documentations

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM