2012-12-19 28 views
5

全球寶石運行宙斯(更新:由zsh的問題,請參閱接受的答案)紅寶石Rbenv嘗試從捆綁儘管它是(使用ZSH)

很久以前,我遵循了這一偉大的指導使用Rbenv與打捆https://gist.github.com/1384279和Ruby Land都很好。 (我正確安裝了它)

Bundler gem安裝在全局目前的ruby版本。每個項目的所有寶石都是從其各自的gemfiles安裝的。

我試圖安裝宙斯全球(比如如何捆綁器全球的裝機量),而不是將它添加到每個項目的Gemfile中。

[email protected]:~/some_project 
> rbenv versions 
    1.9.3-p194 
* 1.9.3-p327-perf (set by /Users/joe/some_project/.rbenv-version) 

[email protected]:~/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems 
> ls -a 
.     method_source-0.7.1 zeus-0.13.1 
..     rake-0.9.2.2 
bundler-1.2.0.rc.2 rdoc-3.9.4 

我已經成功了,因爲你可以看到宙斯是全球一起捆綁安裝...但是:

[email protected]:~/some_project 
> rbenv rehash 

[email protected]:~/some_project 
> zeus init 
Users/joe/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/rubygems_integration.rb:147:in `block in replace_gem': zeus is not part of the bundle. Add it to Gemfile. (Gem::LoadError) 
from /Users/joe/.rbenv/versions/1.9.3-p327-perf/bin/zeus:22:in `<main>' 

據我可以看出,目前正在尋求宙斯,就好像它是捆綁已安裝,但其未捆綁安裝其全局安裝。

如何在綁定寶石之前獲取shell查看全局寶石?

+0

我也有這個問題。捆綁器中的錯誤也許? –

+0

你是否偶然使用ZSH? –

+0

是啊,用ZSH =) – xxjjnn

回答

5

如果我猜中了,你跟我有同樣的問題,您還運行zsh的,那麼這個問題是,哦,我的-的zsh使用捆綁自動換一些命令,如果你有安裝插件的捆綁。

參見:https://github.com/robbyrussell/oh-my-zsh/pull/1507

https://github.com/robbyrussell/oh-my-zsh/pull/1138

https://github.com/heroku/heroku/issues/173

編輯:這已被固定在OH-MY-的zsh

+0

謝謝,我用'CD〜/·OH-MY-的zsh && gl'更新和工作 – juanpastas

+0

@juanpastas這並沒有爲我工作,我仍然看到'找不到命令:宙斯。「有什麼建議嗎? –

+0

我不知道哪個zeus輸出給我:'〜/ .rvm/gems/ruby​​-2.0.0-p247/bin/zeus',那個路徑在我的'PATH'中。我希望這給一些幫助。 – juanpastas

4

如果你確實有這個問題,哦,我的-的zsh和無論出於什麼原因,你還沒有更新,你可以預先加上一個反斜槓的zeus,例如:

% \zeus start 
% \zeus g model Post title content:text 
% \zeus rake db:migrate 

反斜槓的作用是運行命令覆蓋任何別名。請參閱維基百科上的此部分http://en.wikipedia.org/wiki/Alias_(command)#Overriding_aliases