Bundler使用旧的Ruby版本

Bundler使用旧的Ruby版本,ruby,Ruby,我在尝试执行捆绑安装时遇到此错误: Gem::InstallError: rex-core requires Ruby version >= 2.2.0. An error occurred while installing rex-core (0.1.10), and Bundler cannot continue. Make sure that `gem install rex-core -v '0.1.10'` succeeds before bundling. 因此,尽管我按照指

我在尝试执行
捆绑安装时遇到此错误

Gem::InstallError: rex-core requires Ruby version >= 2.2.0.
An error occurred while installing rex-core (0.1.10), and Bundler
cannot continue.
Make sure that `gem install rex-core -v '0.1.10'` succeeds before bundling.
因此,尽管我按照指示继续安装丢失的
rex-core
软件包,但错误依然存在。执行
捆绑更新
也无济于事

作为补充信息:

$ ruby -v
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]

我应该怎么做才能解决这个问题呢?

如果你
gem安装rex-core-v'0.1.10'
它说:成功安装了rex-core-0.1.10看起来你的
bundle
命令使用的Ruby与其他命令不同。检查您的
$PATH
。您还可以尝试使用
gem install bundler
在当前Ruby中再次安装bundler。这是我的$PATH:/home/user/.rbenv/shimmes:/home/user/.rbenv/bin:/home/user/.rbenv/plugins/ruby build/bin:/home/user/.rbenv/shimmes:/home/user/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/usr/games:/usr/local/games:/home/user/.rvm/bin您看到任何可疑的东西了吗?