简体   繁体   English

找不到宝石捆绑器Ruby

[英]can't find gem bundler Ruby

Using Mac OS 13, rbenv. 使用Mac OS 13,rbenv。

ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17] ruby 2.5.0p0(2017-12-25修订版61468)[x86_64-darwin17]

Rails 5.1.4 Rails 5.1.4

Bundler version 1.16.1 Bundler版本1.16.1

rbenv 1.1.1 rbenv 1.1.1

I'm trying to start a new Rails application and then getting this: 我正在尝试启动一个新的Rails应用程序,然后得到这个:

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems.rb:241:in `bin_path': can't find gem bundler (>= 0) (Gem::GemNotFoundException)
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/generators/app_base.rb:382:in `bundle_command'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/generators/app_base.rb:416:in `run_bundle'
from (eval):1:in `run_bundle'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `block in invoke_all'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `each'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `map'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `invoke_all'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/group.rb:232:in `dispatch'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/application/application_command.rb:24:in `perform'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/cli.rb:16:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/exe/rails:9:in `<top (required)>'
from /usr/local/bin/rails:22:in `load'
from /usr/local/bin/rails:22:in `<main>'

As I understand it has something to do with a version of Ruby but I have no idea how to resolve the issue. 据我所知,它与Ruby版本有关,但我不知道如何解决这个问题。

看起来您可能需要执行gem install bundler并获取bundler gem以启动并运行rails。

STEP (1): install the bundler gem: STEP(1):安装bundler gem:

sudo gem install bundler

Once completed, you should get a message similar to this: 完成后,您应该收到类似这样的消息:

Fetching: bundler-1.16.1.gem (100%)
Successfully installed bundler-1.16.1
Parsing documentation for bundler-1.16.1
Installing ri documentation for bundler-1.16.1
Done installing documentation for bundler after 6 seconds
1 gem installed

STEP (2): try checking the bundler version: 步骤(2):尝试检查捆绑器版本:

bundle -v

You should get a version number like this: 你应该得到这样的版本号:

Bundler version 1.16.1

STEP (3): now you can use bundle install: STEP(3):现在您可以使用bundle install:

bundle install

I hope my answer helps. 我希望我的回答有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Bundler找不到宝石 - Bundler can't find a gem 在heroku上找不到gem bundler(&gt; = 0)(Gem :: GemNotFoundException) - can't find gem bundler (>= 0) (Gem::GemNotFoundException) on heroku 捆绑器:在使用 gem 进行捆绑安装期间找不到带有可执行捆绑包 (Gem::GemNotFoundException) 的 gem bundler (&gt;= 0.a) - Bundler: can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException) during bundle install with gem Ruby on Rails-Bundler找不到宝石“ activerecord”的兼容版本 - Ruby on Rails - Bundler can not find compatible versions for gem “activerecord” Bundler失败,因为它找不到法拉第gem的兼容版本 - Bundler fails because it can't find compatible version of faraday gem Ruby 导轨错误:捆绑器找不到 gem“捆绑器”的兼容版本: - Ruby rails error: Bundler could not find compatible versions for gem "bundler": TRAVIS CI:`find_spec_for_exe':找不到带有可执行包的 gem bundler (&gt;= 0.a) (Gem::GemNotFoundException) - TRAVIS CI: `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException) 找不到捆绑器 - can't find Bundler Bundler似乎无法通过Rbenv找到正确的Ruby - Bundler can't seem to find correct Ruby through Rbenv Bundler甚至认为它出现在gem列表中也找不到win32-service gem - Bundler can't find win32-service gem even thought it appears in gem list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM