我使用MacPorts安装了Capistrano,但是capify找不到Capistrano gem



在OS X 10.7.5上使用MacPorts安装capistrano

[~] > install rb-capistrano

但是当我运行capify时,我得到以下错误:

/opt/local/lib/ruby/vendor_ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem capistrano (>= 0) (Gem::LoadError)
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems.rb:214:in `activate'
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems.rb:1082:in `gem'
from /opt/local/bin/capify-1.8:18

这显然是一个bug与MacPorts部署的capistrano, ruby和宝石,但有没有一种方法,我可以在此期间解决这个问题?我只是想让Capistrano工作,我不关心Ruby on Rails或任何Ruby的东西。

这是我的解决方案:要么手动安装gem,要么使用rvm安装它,完全绕过MacPorts。

我选择选项1:使用"gem"来安装Capistrano。这当然包括安装MacPorts gem并修复安装以使其实际工作:

12:10 ~project ➤ which gem
/usr/bin/gem
12:10 ~project ➤ sudo port install rb-rubygems
12:11 ~project ➤ ln -s /opt/local/libexec/ruby1.8/gem /opt/local/bin/gem
12:11 ~project ➤ sudo gem install capistrano                                         
Successfully installed highline-1.6.19
Successfully installed net-ssh-2.6.7
Successfully installed net-ssh-gateway-1.2.0
Successfully installed capistrano-2.15.4
4 gems installed
Installing ri documentation for highline-1.6.19...
Installing ri documentation for net-ssh-2.6.7...
Installing ri documentation for net-ssh-gateway-1.2.0...
Installing ri documentation for capistrano-2.15.4...
Installing RDoc documentation for highline-1.6.19...
Could not find main page README
Could not find main page README
Could not find main page README
Could not find main page README
Installing RDoc documentation for net-ssh-2.6.7...
Installing RDoc documentation for net-ssh-gateway-1.2.0...
Installing RDoc documentation for capistrano-2.15.4...
12:12 ~project ➤ which capify
/opt/local/bin/capify
12:12 ~project ➤ capify .
[add] making directory './config'
[add] writing './config/deploy.rb'
[add] writing './Capfile'
[done] capified!

正如你所看到的,gem为我做了"正确的事情",安装到/opt/local/(即:MacPorts)目录。

向MacPorts报告的错误为https://trac.macports.org/ticket/39467

相关内容

最新更新