解决了前些天安装ROR环境时候的一个遗留问题

前写天安装ROR环境的时候,重启系统开启一个shell使用命令

rails -v

显示rails尚未安装

但是安装aptana之后在aptana里面打开控制台就可以正常显示版本,应该是aptana自动加载了路径和函数吧

昨天看《RailsStutorial2》里面推荐了https://github.com/perfectionist/sample_project/wiki的开发简例

正好里面有较为详细的环境配置教程(比国内那些配置教程有用的信息要多的多)就发现了加载路径和函数的方法:

Setup PATH and define rvm function.
To use rvm just type

source ~/.rvm/scripts/rvm

into open shells, this creates the rvm function and adds various ~/.rvm/... directories to PATH.
You can also add this line to your ~/.bashrc file so it takes affect for all new shells.
I was going to use a slightly different approach so I defined an alias

use_rvm='source ~/.rvm/scripts/rvm'

and then invoked it when I needed to use rvm from the command line.

But I decided to install the following line in my .bash_profile

-s "$HOME/.rvm/scripts/rvm" && source "$HOME/.rvm/scripts/rvm"

You can add the line to your .bash_profile or .bashrc file depending how you set your environment up. This defines the rvmfunction and modifies your PATH only if the the ~/.rvm/scripts/rvm file exists. This is preferable to just adding the source statement.

推荐第一种方法,即使多开几个shells也都是可以的,不过现在使用的RubyMine IDE这些问题都不存在,但是,有问题了还是解决了比较安心,呵呵~~~~~~


补充:升级最新版的rvm好像能直接自动添加了~~~~~

rvm update




转载于:https://my.oschina.net/zoker/blog/195488

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值