gpt4 book ai didi

ruby-on-rails - RVM 不更改 Mac 上的 Ruby 版本

转载 作者:行者123 更新时间:2023-12-04 17:46:30 26 4
gpt4 key购买 nike

我试图在 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​​ 版本,但它没有在我的目录中检测到它。我已经关闭并在新的终端窗口中重试了几次。

最佳答案

看起来我在设置 RVM 之前安装了 bundler 。运行 gem install bundler,现在我可以捆绑安装并且一切正常。

关于ruby-on-rails - RVM 不更改 Mac 上的 Ruby 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48287458/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com