简体   繁体   English

Rails命令不存在

[英]Rails command doesn't exist

In Ubuntu 12.04, gem install rails succeeds, but when I try rails -v I get an error message saying: 在Ubuntu 12.04中, gem install rails成功,但是当我尝试使用rails -v我收到一条错误消息:

The program rails is currently not installed. 当前未安装程序导轨。 You can install it by ... 您可以通过...安装它

How can I get the rails command to work? 如何使rails命令起作用?

I've never had this problem, but for rails to be found, the rails binary file must be on the path. 我从来没有遇到过这个问题,但是要找到rails,rails二进制文件必须在路径上。 That is, in a directory listed in the PATH environment variable. 也就是说,在PATH环境变量中列出的目录中。

To see the value of the PATH environment variable. 查看PATH环境变量的值。

echo $PATH
env | grep PATH

You might try uninstalling rails, and then reinstalling. 您可以尝试卸载Rails,然后重新安装。

Problem solved!!! 问题解决了!!!

I just type source .rvm/scripts/rvm in my HOME path, and it works!!! 我只是在我的HOME路径中输入source .rvm/scripts/rvm ,它可以正常工作!!!

You should put the following in your ~/.profile or ~/.bashrc , because in your solution you will need to write your source ... after every reboot: 您应该将以下内容放入~/.profile~/.bashrc ,因为在解决方案中,每次重新启动后都需要编写source ...

# This loads RVM into a shell session.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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