Mac OS X 下配置 ruby 环境变量的问题?

Python011

Mac OS X 下配置 ruby 环境变量的问题?,第1张

1 打开你的.bash_profile, 把 export PATH=/usr/local/Cellar/ruby/1.9.3-p327/bin:$PATH 加进去

2 .bash_login只是针对iterm的吧,真正对环境变量起作用的是.bash_profile,当然一般.bash_profile也会加载.bashrc的内容,所以你也可以在.bashrc里面修改

ps: 这些应该是 shell的基本知识

var = "Value"

str = "a test Value"

puts str.gsub( /#{var}/, 'foo' ) # =>"a test foo"