To build the ruby runtime environment on Mac

Setup ruby env:


1. install RVM(RUBY version manage)

curl -L https://get.rvm.io | bash -s stable


/Users/yaya.feng/.rvm/scripts/rvm    (the installation of rvm directory)       run command on terminal

rvm -v         view installation of rvm is it correct.


restart terminal;

rvm

rvm list known    install ruby, display the version of ruby 


2.  Update the environment for RVM:

source ~/.rvm/scripts/rvm(/Users/yaya.feng/.rvm/scripts/rvm )

 3. Now install the latest version of Ruby:

rvm install 2.2.4

 4.  To set ruby 2.2.4 as the default one, type:

rvm --default use 2.2.4(version)



question: config env path after installing ruby-----------? (i guess auto config path , wen can check it by env command on terminal)

we can install multiple version of ruby on mac, and we can set default ruby version for using.


 remove the version of ruby :

sudo rvm remove 2.3.0  remove ruby version



Run the first ruby program——hello world

  1. write “hello world “on sublime text editor and then save it as filename.rb file on desktop
  2. run “ruby ./helloWorld.rb” file on terminal, and then print content on terminal.

env path:

rvm_bin_path=/Users/yaya.feng/.rvm/bin  

rvm_path=/Users/yaya.feng/.rvm 

rvm_prefix=/Users/yaya.feng 

PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/yaya.feng/.rvm/bin:/Users/yaya.feng/.rvm/bin


rvm_version=1.27.0 (latest)


use env command view all env path list;



Attached the reference link

http://www.cnblogs.com/daguo/p/4097263.html ;

http://www.runoob.com/ruby/ruby-environment-variables.html ;

https://en.wikibooks.org/wiki/Ruby_Programming/Hello_world ;

http://guides.ruby-china.org/getting_started.html ; ruby on rails(web framework)

http://www.techbar.me/setting-up-a-ruby-development-environment-on-mac-os/  ;

http://code.tutsplus.com/tutorials/how-to-install-ruby-on-a-mac--net-21664

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值