如何使用rbenv使bundler v2缺省而不是v1.7?

时间:2019-08-21 10:46:54

标签: ruby-on-rails ruby bundler rbenv

在具有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 rubywhich gemwhich bundler确实指向垫片。

如何使bundler实际上是最新的捆绑软件?

0 个答案:

没有答案