Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. # How to install Ruby 2.0.0-p247 on Mac OSX 10.7+
  2.  
  3. ## RVM:
  4.  
  5. ```
  6. rvm get stable && rvm reload
  7. ```
  8.  
  9. Firstly, the OpenSSL comes with your OSX 10.7+ is outdated, you need to get latest version
  10.  
  11. ```
  12. rvm pkg install openssl
  13. ```
  14.  
  15. Secondly, the readline library on OSX 10.7+ suffers UTF-8 issue in which method in UTF-8 is converted to characters under `irb`, the
  16. fix is to use latest version
  17.  
  18. ```
  19. rvm pkg install readline
  20. ```
  21.  
  22. And you can install Ruby 2.0.0-p247 with:
  23.  
  24. ```
  25. rvm reinstall 2.0.0 --with-readline-dir=$rvm_path/usr --with-openssl-dir=$rvm_path/usr
  26. ```
  27.  
  28. Please note that `clang-425.0.24` that comes with Xcode successfully compile the source, should you bump into any compilation issue, you could try compiling it with `gcc-422`
  29.  
  30. ## rbenv
  31.  
  32. Make sure your `ruby-build` is up-to-date:
  33.  
  34. ```
  35. cd ~/.rbenv/plugins/ruby-build && git pull
  36. ```
  37.  
  38. rbenv does not fetch fixed readline lib, thus you are required to install them manually with `brew`:
  39.  
  40. ```
  41. brew update
  42. brew install readline openssl
  43. CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install 2.0.0-p247
  44. ```
  45.  
  46. ## chruby + ruby-build
  47.  
  48. If you happen to use something simpler than rbenv and rvm, such as chruby, you can still use ruby-build to compile ruby into
  49. your local `~/.rubies` folder with:
  50.  
  51. ```
  52. brew update
  53. brew install readline openssl
  54. CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" ruby-build 2.0.0-p247 ~/.rubies/ruby-2.0.0-p247
  55. ```
  56.  
  57. then insert into the top of your `~/.bash_profile` to use it by default:
  58.  
  59. ```
  60. chruby ruby-2.0.0-p247
  61. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement