在具有rbenv
的系统中,我无法使bundle
的版本为2. *而不是1.7。*。
这是在Ubuntu 16.04中。
我的安装脚本大致如下:
apt-get -y update
apt-get -y install git bzip2 curl wget apt-transport-https htop make gcc libssl-dev libreadline-dev zlib1g-dev
git clone https://github.com/rbenv/rbenv.git "$HOME/.rbenv"
git clone https://github.com/rbenv/ruby-build.git "$HOME/.rbenv/plugins/ruby-build"
# Prepare .bashrc for next sessions
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> "$HOME/.bashrc"
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> "$HOME/.bashrc"
echo 'eval "$(rbenv init -)"' >> "$HOME/.bashrc"
# Load rbenv in this session
export PATH="$HOME/.rbenv/bin:$PATH"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
eval "$(rbenv init -)"
RUBY_VERSION='2.3.8'
rbenv install "$RUBY_VERSION"
rbenv global "$RUBY_VERSION"
gem update --no-document --system
gem install bundler --no-document --version '~>2.0'
rbenv rehash
bundle --version
# Bundler version 1.17.3
注意:which ruby
,which gem
和which bundler
确实指向垫片。
如何使bundler
实际上是最新的捆绑软件?