【发布时间】:2018-01-16 18:15:12
【问题描述】:
我正在尝试在 Mac 上更改我的 ruby 版本,即使它说它在正确的 ruby 版本 (2.3.4) 上,它仍然无法正常工作。
示例输出:
:~ my_username$ cd my_project_name
:my_project_name my_username$ which ruby
/Users/my_username/.rvm/rubies/ruby-2.3.4/bin/ruby
:my_project_name my_username$ ruby -v
ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-darwin16]
:my_project_name my_username$ bundle install
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.3.2 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.3.2
Your Ruby version is 2.5.0, but your Gemfile specified 2.3.4
:my_project_name my_username$
和 RVM 列表,然后尝试为我的项目捆绑安装:
:my_project_name my_username$ rvm list
rvm rubies
=* ruby-2.3.4 [ x86_64 ]
ruby-2.4.0 [ x86_64 ]
ruby-2.4.1 [ x86_64 ]
ruby-2.4.2 [ x86_64 ]
# => - current
# =* - current && default
# * - default
:my_project_name my_username$ bundle install
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.3.2 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.3.2
Your Ruby version is 2.5.0, but your Gemfile specified 2.3.4
:my_project_name my_username$
如您所见,我安装了 2.3.4 并设置为当前的 ruby 版本,但它在我的目录中没有检测到它。我已经在新的终端窗口中关闭并重试了几次。
【问题讨论】:
-
我遇到了完全相同的问题,但就我而言,我什至无法安装 bundler
标签: ruby-on-rails ruby macos rvm macos-sierra