rails尚未安装 的解决方法

2 篇文章 0 订阅

按照淘宝Ruby的rails安装指南和RubyChina的Rails环境配置指南配置好了Rails环境,可第二天突然抽风,找不到rails bundle等命令

不可能啊,第一次安还测试过安对了,东找西找,两大种解释,环境变量和环境变量 RubyChina的问题讨论

可是为什么第一次是好的呢?

哦,终于发现一篇有用的文章了,看来找问题还是得去官网啊

rvm官网解答 shell --> 编辑 --> 配置文件首选项 --> 标题和命令 --> 勾选以登陆shell方式运行命令


解释在此:

What shell login means ('bash -l')

There are sites that describe this how it was 10 years ago like here orhere so read to see how it works in current world:

  1. When you login graphically to your system it will read `~/.profile` so you put there settings like `LANG` which are important for graphical applications
  2. When you open a terminal (except Gnome-terminal & Screen) you open a `login` shell which sources `~/.bash_profile`
  3. When you execute commands in non login shell like `ssh server command` or `scp file server:~` or `sudo`(without -i) or `su` (without -l) it will execute `~/.bashrc`

`~/.bashrc` is meant for non login invocations, you should not print there any output - it makes tools like `scp` to fail

it is good idea to put environment variables in `~/.bashrc`, things that you depend upon in your scripts (for `ssh server script`)

then if your system does not source `~/.bashrc` by default via `/etc/profile` you should source it in `~/.bash_profile` file so any login shell will have access also to the same environment like non login sessions.

RVM by default adds itself currently to `~/.bash_profile` file, and the recommended way is to enable login shell in gnome-terminal (and screen).



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值