Linux Mint 11 上的 Rails
我已经通过 rvm 在 Mint 11 上安装了 ruby,没问题。安装宝石,同上。通过 gem install Rails 安装了 Rails,当我输入 rails -v
时,它会返回正确的版本。直到我关闭该终端并重新打开终端。当我这样做并输入 rails -v
时,我收到消息
The program 'rails' is currently not installed. You can install it by typing: sudo apt-get install rails
如果我然后输入
rvm use 1.9.2-p180 --default
然后输入 rails -v
我再次获得正确的版本...直到我关闭终端。
我应该补充一点,我已在 .bashrc
中添加了一条路径语句,指向 .rvm
目录中的 1.9.2-p180
目录。
输入ruby -v
始终返回正确的版本。
I have installed ruby via rvm on Mint 11 no problem. Installed gems, ditto. Installed rails via gem install rails, and when I type rails -v
it returns the correct version. Until I close that terminal and reopen a terminal. When I do that and type rails -v
I get the message
The program 'rails' is currently not installed. You can install it by typing: sudo apt-get install rails
If I then type
rvm use 1.9.2-p180 --default
and then type rails -v
I again get the correct version...until I close the terminal.
I should add that I have added a path statement to my .bashrc
pointing to the 1.9.2-p180
directory in my .rvm
directory.
Typing ruby -v
always returns the correct version.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
创建 .bashrc 文件并添加 .rvm 命令
(将行添加到 .bashrc 文件)
注销并登录或仅使用以下命令从 .bashrc 更新用户配置文件
Create .bashrc file and add .rvm command
(Add line to .bashrc file)
Logout and Login OR just update user profile from .bashrc with following command
尝试将此命令添加到您的
.profile
中并重新打开您的 shell:Try adding this command to your
.profile
and reopening your shell:使用项目 rvmrc 文件。您可以在此处查看如何设置 http://beginrescueend.com/rvm/best-practices/< /a>
这样你就可以将每个项目的所有 gem 分开,并且设置起来非常简单
Use project rvmrc files. You can see how to set this up here http://beginrescueend.com/rvm/best-practices/
That way you keep all your gems seperate for each project and it's dead simple to set up
尝试
哪个轨道
。也许有一个存根链接可以为您提供注释。如果是这种情况,调用完整路径可能会有所帮助,例如
/usr/local/bin/rails
Try
which rails
. Maybe there is a link to a stub that gives you the note.If that is the case calling the full path might help, e.g.
/usr/local/bin/rails