rvm做了很多“不为人知”的事情,而且做的太多了,对技术人员这点不好,技术如果不能理解原理,本身就有问题了。
rbenv相对来说“不为人知”的事情少些。
rbenv:https://github.com/sstephenson/rbenv
rbenv的ruby-build:https://github.com/sstephenson/ruby-build#readme
一个插件:rbenv-pluger: https://github.com/cao7113/rbenv-pluger
安装方式:rbenv install 2.0.0-p111 安装过程很慢。
ruby-build提供了很多变量来覆盖自动安装时的包下载位置,缓存位置等。
Special environment variables
You can set certain environment variables to control the build process.
TMPDIR sets the location where ruby-build stores temporary files.
RUBY_BUILD_BUILD_PATH sets the location in which sources are downloaded and built. By default, this is a subdirectory of TMPDIR.
RUBY_BUILD_CACHE_PATH, if set, specifies a directory to use for caching downloaded package files.
RUBY_BUILD_MIRROR_URL overrides the default mirror URL root to one of your choosing.
RUBY_BUILD_SKIP_MIRROR, if set, forces ruby-build to download packages from their original source URLs instead of using a mirror.
CC sets the path to the C compiler.
RUBY_CFLAGS lets you pass additional options to the default CFLAGS. Use this to override, for instance, the -O3 option.
CONFIGURE_OPTS lets you pass additional options to ./configure.
MAKE lets you override the command to use for make. Useful for specifying GNU make (gmake) on some systems.
MAKE_OPTS (or MAKEOPTS) lets you pass additional options to make.
MAKE_INSTALL_OPTS lets you pass additional options to make install.
RUBY_CONFIGURE_OPTS, RUBY_MAKE_OPTS and RUBY_MAKE_INSTALL_OPTS allow you to specify configure and make options for buildling MRI. These variables will be passed to Ruby only, not any dependent packages (e.g. libyaml).
解决方法:
#1 自己下载安装包,可以利用taobao的源
#2 rbenv安装时指定刚刚下载的包
cd ~/.rbenv/versions
wget http://ruby.taobao.org/mirrors/ruby/2.0/ruby-2.0.0-p451.tar.gz
env RUBY_BUILD_MIRROR_URL=file:///root/.rbenv/versions/ruby-2.0.0-p451.tar.gz# rbenv install 2.0.0-p451
rbenv global 2.0.0-p451
参考:
rbenv安装太慢的解决办法
0
0
o
o
0
0