Rails - Bundle:找不到命令

时间:2015-12-25 03:12:16

标签: ruby-on-rails ruby

当我尝试在Mac上运行/检查捆绑包时遇到问题 当我做gem list --local

时,Bundler / bundler在本地gem列表中

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返回

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

哪个宝石返回

/usr/bin/gem

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

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

并且没有运气......

2 个答案:

答案 0 :(得分:74)

您的计算机上似乎未安装 Bundler

您必须首先安装捆绑包

1: gem install bundler

2: bundle install

希望这能帮到你!!!

答案 1 :(得分:2)

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

gem install bundler

然后,再试一次。

请参阅documentation