ruby 我能够成功运行gem install安装程序,但仍然得到“找不到'安装程序'”

5uzkadbs  于 2023-10-17  发布在  Ruby
关注(0)|答案(1)|浏览(175)

设置我的旧英特尔苹果笔记本电脑运行ventura 13.4.1,尝试从头开始使用ruby-3.1.3创建一个全新的rails 7应用程序。我下载了最新的命令行工具。我运行gem install bundler --version 2.3.26 --default得到

Successfully installed bundler-2.3.26 as a default gem

然后下一行

ERROR:  While executing gem ... (Errno::ENOENT)
    No such file or directory @ dir_chdir - /usr/local/lib/ruby/gems/3.2.0/specifications/gems/bundler-2.3.26

我运行gem install bundler得到

Successfully installed bundler-2.4.19
Parsing documentation for bundler-2.4.19
Done installing documentation for bundler after 0 seconds
1 gem installed

我运行gem list bundler得到

*** LOCAL GEMS ***

bundler (2.4.19, 2.3.26)

我运行bundler -v,得到

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.3.26) required by your /Users/kendallcarey/repos/broadway-blog/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.3.26`

我试过运行gem install bundler:2.3.26很多次,这是我的Gemfile.lock中的版本。我甚至运行了gem update --system,没有任何变化。如何让bundle install工作?

waxmsbnn

waxmsbnn1#

原来是Ruby版本。我能够在运行服务器的选项卡上运行bundle install,而新选项卡使用的是不同版本的ruby。

相关问题