Ruby-on-rails Rails - 捆绑包:找不到命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34459720/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 00:20:35  来源:igfitidea点击:

Rails - Bundle: command not found

ruby-on-railsruby

提问by Jenny Chen

Encountered a problem when I tried to run/check bundle on on Mac Bundler/bundler are in the local gem list when I did gem list --local

当我尝试在 Mac 上运行/检查包时遇到问题 Bundler/bundler 在我执行 gem list --local 时位于本地 gem 列表中

Gem env returns the following

Gem env 返回以下内容

 RubyGems Environment:
      - RUBYGEMS VERSION: 2.0.14
      - RUBY VERSION: 2.0.0 (2014-05-08 patchlevel 481) [universal.x86_64-darwin14]
      - INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0
      - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
      - EXECUTABLE DIRECTORY: /usr/bin
      - RUBYGEMS PLATFORMS:
        - ruby
        - universal-darwin-14
      - GEM PATHS:
         - /Library/Ruby/Gems/2.0.0
         - /Users/jenny0322/.gem/ruby/2.0.0
         - /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0
      - GEM CONFIGURATION:
         - :update_sources => true
         - :verbose => true
         - :backtrace => false
         - :bulk_threshold => 1000
      - REMOTE SOURCES:
         - https://rubygems.org/

Echo Path returns

回声路径返回

/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin

which gem returns

哪个 gem 返回

/usr/bin/gem

How do I add path to the directory? I tried

如何添加目录路径?我试过

export PATH ="/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin:$PATH"

and have no luck...

没有运气...

回答by Gupta

It seems that Bundleris not installed in your machine.

您的机器中似乎没有安装Bundler

You have to install bundler firstfor that.

为此,您必须先安装 bundler

1:gem install bundler

1:gem install bundler

2:bundle install

2:bundle install

Hope this help you !!!

希望这对你有帮助!!!

回答by K M Rakibul Islam

Open a new terminal window and run:

打开一个新的终端窗口并运行:

gem install bundler

gem install bundler

Then, try again.

然后,再试一次。

See the documentation.

请参阅文档