Gem install不会创建bin的链接

时间:2013-09-26 09:13:32

标签: ruby rubygems gem cocoapods

我正在尝试在Mac上安装cocoapods

Successfully installed cocoapods-0.25.0
1 gem installed

但是

$ pod install
-bash: pod: command not found

使用brew

安装Ruby
$ which ruby
/usr/local/bin/ruby

$ which gem
/usr/local/bin/gem

以下是gem environment

的输出
$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.3
  - RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [x86_64-darwin12.5.0]
  - INSTALLATION DIRECTORY: /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0
  - RUBY EXECUTABLE: /usr/local/Cellar/ruby/2.0.0-p247/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/Cellar/ruby/2.0.0-p247/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-12
  - GEM PATHS:
     - /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0
     - /Users/nt/.gem/ruby/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--no-rdoc --no-ri"
     - "update" => "--no-rdoc --no-ri"
  - REMOTE SOURCES:
     - https://rubygems.org/

我应该导出或添加到.bash_profile以使pod install正常工作?

2 个答案:

答案 0 :(得分:2)

如果您像我一样使用rbenv,则在安装gem之后,您必须运行 rbenv rehash 以获取shims目录中的链接。

答案 1 :(得分:1)

我的不好,.bash_profile中的这一行有帮助

export PATH=$PATH:/usr/local/Cellar/ruby/2.0.0-p247/bin