鋼の鍊魔術師

嵌入 FreeBSD 的心,修的是魔道還是正道?

Fork me on GitHub

Change RVM to Rbenv

I use RVM for days but I don’t really like it. Someday I found there is a replacement called rbenv and I just give it a try.

It’s really simple with the following steps.

  • Clean your RVM environment:
1
$ rm -rf ~/.rvm
  • Please remove the following line from your Zsh or Bash environment. [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

  • Quit your current terminal and open new one.

(Or just source ~/.zshrc or your refresh your bash settings at the same console.)

  • Install ruby-build:

(Because ruby-build has rbenv-install command)

1
$ cd; git clone git://github.com/sstephenson/ruby-build.git; cd ruby-build; ./install.sh
  • Intsall rbenv:

(You must change .zshrc to .bash_profile if you use bash. Also, bash has no rehash command, you must use rbenv rehash to rehash your shell environment)

1
2
3
4
5
6
7
8
$ git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
$ echo 'eval "$(rbenv init -)"' >> ~/.zshrc
$ source ~/.zshrc
$ rbenv-install 1.9.2-p290
$ rehash
$ rbenv global 1.9.2-p290
$ gem install rails # just for test

refer and learn more rbenv commands:

  1. https://github.com/sstephenson/rbenv
  2. https://github.com/sstephenson/ruby-build

Comments