2013-06-19 27 views
0

使用的MacPorts在OS X 10.7.5我Capistrano的安裝如下:我安裝使用Capistrano的MacPorts的,但capify找不到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 

這顯然是一個與MacPorts部署capistrano,紅寶石和寶石的錯誤,但有沒有辦法解決這個問題?我只想讓Capistrano工作,我根本不在乎Ruby on Rails或Ruby。

+0

我肯定會避免使用其他包管理系統安裝寶石的代理。另外,Ruby 1.8已經停止使用,並且不再接收安全更新;您應該立即升級到Ruby 2.0(或1.9)。 –

+0

很遺憾,1.8是你在'sudo port install ruby​​'時得到的。感謝您的警告! – ManicDee

回答

0

以下是我的解決方法:手動安裝gem,或使用rvm進行安裝,完全繞過MacPorts。

我選擇了選項1:使用「gem」來安裝Capistrano。當然,這涉及到安裝MacPorts的寶石和固定安裝到實際工作:

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! 

正如你可以看到,創業板通過安裝到/ opt做「正確的事」對我/本地/(即:使用MacPorts)目錄。

這已被錯誤報道的MacPorts爲https://trac.macports.org/ticket/39467

+0

正如@AndrewMarshall所說,使用其他軟件包管理器時使用gem來安裝軟件包是一件壞事。在這種情況下,清理混亂與重新安裝MacPorts一樣簡單(即:rm -rf/opt/local,然後從頭開始)。這並不像我現在打破MacPorts一樣。 – ManicDee

相關問題