加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 如何使用RVM将Ruby更改为1.9.3版(再次)?

发布时间:2020-12-17 04:05:54 所属栏目:百科 来源:网络整理
导读:我曾经在Ubuntu上使用 Ruby版本1.9.3并进行了更新,可能搞砸了我的bash配置文件,我需要帮助才能将其转回而不是使用版本1.8.7.现在rails使用Ruby 1.8.7打开服务器,因为我在我的应用程序中使用了更新的语法而出现错误. .bash_profile文件: cat ~/.bash_profile
我曾经在Ubuntu上使用 Ruby版本1.9.3并进行了更新,可能搞砸了我的bash配置文件,我需要帮助才能将其转回而不是使用版本1.8.7.现在rails使用Ruby 1.8.7打开服务器,因为我在我的应用程序中使用了更新的语法而出现错误.

.bash_profile文件:

cat ~/.bash_profile

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

哪个铁轨:

/usr/local/bin/rails

哪个ruby:

/usr/bin/ruby

ruby -v:

ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]

rvm列表:

rvm rubies

=* ruby-1.9.3-p194 [ i686 ]

# => - current
# =* - current && default
#  * - default

rvm使用1.9.3:

RVM is not a function,selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.

解决方法

您不在登录shell中.要进入登录shell,请尝试以下命令:

/bin/bash --login

之后,您将能够使用RVM选择Ruby.

此外,还有永久的方法,每次打开终端时都不必写这行.
试试这个:

Edit menu -> Profile Preferences

将出现一个对话框,现在在登录shell中选择Run命令.

之后,无论何时打开终端,您都将进入登录shell,并且您将能够使用RVM.

还有另一种方法,你可以在.bash_profile中编写/ bin / bash –login,每次重启时都会加载.bash_profile.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读