find_spec_for_exe':找不到宝石捆绑包(> = 0.a)(Gem :: GemNotFoundException) [英] find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)
问题描述
我使用了 sudo bundle install
,这可能是问题的原因吗?
现在我有:
-
gem -v
2.6.14 -
ruby -v
ruby 2.3.5p376(2017-09-14修订版59905) [x86_64-darwin15] -
jekyll -v
jekyll 3.6.2 -
bundle -v
Bundler版本1.16.0.pre.3
我正在尝试运行 bundle exec jekyll服务
或只是 jekyll服务
$ b时出现以下错误$ b
/Users/myusername/.rvm/rubies/ruby-2.3.5/lib/ruby/site_ruby/2.3.0/rubygems.rb:271:在'find_spec_for_exe'中:无法从/Users/myusername/.rvm/rubies/ruby-2.3.5/lib/ruby/site_ruby/2.3中找到宝石捆绑包(> = 0.a)(Gem :: GemNotFoundException)
。 0 / rubygems.rb:299:在/users/myusername/.rvm/gems/ruby-2.3.5/bin/bundle中的'activate_bin_path'
:23:in`< main>'
来自/Users/myusername/.rvm/gems/ruby-2.3.5/bin/ruby_executable_hooks:15:位于'eval'
来自/Users/myusername/.rvm/gems/ruby-2.3.5/bin/ ruby_executable_hooks:15:in`< MacBooMacBook-MacBook-MacBook-MacBook Pro-MacBook-Pr另外,在访问我的博客 cd my_path
所在的文件夹时,还会收到以下消息:
VM使用您的Gemfile选择Ruby,这也很好-Heroku也这样做,
您可以使用'rvm rvmrc warning ignore / Library / WebServer / Documents / blog / Gemfile'忽略这些警告。
要忽略所有文件的警告,请运行 rvm rvmrc warning忽略所有文件。
未知的红宝石解释器版本(不知道如何处理):RUBY_VERSION。
我不知道如何解决这个。我只想创建我的静态博客,而老实说我对Ruby,Gem或Bundle一无所知:)所以,我将不胜感激!
解决方案我的问题是 Gemfile.lock
文件的 BUNDLED_WITH
版本是 1.16.1
和 gem install bundler
安装的版本 2.0.1
,因此
gem install bundler -v 1.16.1
修复了该文件夹时,版本不匹配
当然,您还可以更改 Gemfile.lock
的 BUNDLED_WITH
和最新的 bundler
版本并使用最新的软件,例如 Sam3000 建议
I used sudo bundle install
and that might be the cause of the issue?
Now I have:
gem -v
2.6.14
ruby -v
ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-darwin15]
jekyll -v
jekyll 3.6.2
bundle -v
Bundler version 1.16.0.pre.3
I'm getting the following error when trying to run bundle exec jekyll serve
or just jekyll serve
/Users/myusername/.rvm/rubies/ruby-2.3.5/lib/ruby/site_ruby/2.3.0/rubygems.rb:271:in `find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)
from /Users/myusername/.rvm/rubies/ruby-2.3.5/lib/ruby/site_ruby/2.3.0/rubygems.rb:299:in `activate_bin_path'
from /Users/myusername/.rvm/gems/ruby-2.3.5/bin/bundle:23:in `<main>'
from /Users/myusername/.rvm/gems/ruby-2.3.5/bin/ruby_executable_hooks:15:in `eval'
from /Users/myusername/.rvm/gems/ruby-2.3.5/bin/ruby_executable_hooks:15:in `<MacBooMacBook-MacBook-MacBook-Pro-MacBook-PrMacBook-MacBooMacBMaMacBMaMaMaMaMaMaMaMaMacBMaMaMaMacBMa
Also, when accessing the folder in which I have my blog cd my_path
I get the following message:
VM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /Library/WebServer/Documents/blog/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.
Unknown ruby interpreter version (do not know how to handle): RUBY_VERSION.
I've no idea how to solve this. I just want to create my static blog and honestly I have no idea about Ruby, Gem or Bundle :) So I would appreciate some insights!
解决方案 The problem in my case is that the Gemfile.lock
file had a BUNDLED_WITH
version of 1.16.1
and gem install bundler
installed version 2.0.1
, so there was a version mismatch when looking to right the folder
gem install bundler -v 1.16.1
fixed it
Of course, you can also change your Gemfile.lock
's BUNDLED_WITH
with last bundler
version and use recent software, as Sam3000 suggests
这篇关于find_spec_for_exe':找不到宝石捆绑包(> = 0.a)(Gem :: GemNotFoundException)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!