简体   繁体   中英

“gem install rails” is 100% and the “rails” is in the “gem list”, but I failed to run “rails -v”

I have install rails by gem. When it finished 100%. I checked it in the gem list. But I failed to run "rails -v". You can get more info as bellows

[root@wlin log]# gem list
... suppresed ....
[root@wlin log]# rails -v
bash: rails: not found the command...

The reason you get bash cannot find the rails command is probably because rails is not in the PATH variable. To add it to the PATH , you can do

export PATH=$PATH:/path/to/rails

where /path/to/rails indicates the absolute path of the rails executable. I am not sure what platform you are on, but you can find where this lives by looking for the bin folder in the rails subdirectory of the INSTALLATION DIRECTORY which can be found by calling

gem env

I hope this solves your problem! :)

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