2013-02-21 64 views
0

今天我第一次跑到可怕的ERROR: Gem bundler is not installed, run gem install bundler打包器錯誤。這裏有很多關於它的問題和調試的許多技巧,但是我開始深入挖掘,奇怪的是,即使刪除了.rvmrcbin.bundle,我也得到了兩個不同項目的不同結果。儘管我可以告訴他們在rvm中應該是一樣的,但是我得到了不同的結果。在兩個新鮮的bash窗口中,Linux Mint:爲什麼rvm改變沒有rvmrc的路徑?

~ $ cd ${PROJECT_PATH}/project1 
project1 $ echo $PATH 
/usr/local/heroku/bin:/home/fletch/.rvm/gems/ruby-1.9.3-p385/bin:/home/fletch/.rvm/gems/[email protected]/bin:/home/fletch/.rvm/rubies/ruby-1.9.3-p385/bin:/home/fletch/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games 
project1 $ tree -L 1 -a 
. 
|-- app 
|-- config 
|-- config.ru 
|-- db 
|-- Gemfile 
|-- Gemfile.lock 
|-- .git 
|-- .gitignore 
|-- Guardfile 
|-- lib 
|-- log 
|-- Procfile 
|-- public 
|-- Rakefile 
|-- .rspec 
|-- script 
|-- spec 
|-- tmp 
`-- vendor 

11 directories, 15 files 

這是所需的輸出。現在爲另一個項目:

~ $ cd ${PROJECT_PATH}/project2 
project2 $ echo $PATH 
/home/fletch/.rvm/gems/ruby-1.9.3-p385/bin:/home/fletch/.rvm/rubies/ruby-1.9.3-p385/bin:/home/fletch/.rvm/bin:/usr/local/heroku/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games 
project2 $ tree -L 1 -a 
. 
|-- app 
|-- config 
|-- config.ru 
|-- coverage 
|-- db 
|-- Gemfile 
|-- Gemfile.lock 
|-- .git 
|-- .gitignore 
|-- Guardfile 
|-- lib 
|-- log 
|-- public 
|-- Rakefile 
|-- README.md 
|-- .rspec 
|-- script 
|-- spec 
|-- tmp 
`-- vendor 

12 directories, 8 files 

爲什麼我的路徑不同?第二個不會加載全局gemset,並且由於某種原因還會將heroku位移回去。作爲參考,當我打開一個新的控制檯時,我的默認路徑與第一個路徑相匹配。 rvm是否在內存或某個全局文件中保留了哪些項目使用哪些版本?我無法辨別出我的項目中的任何模式。有些工作,有些則不。

回答

1

RVM支持,不只是.rvmrc一個這個文件是Gemfile與任bundler指令指定紅寶石:

ruby='1.9.3' 

或具有偏好,是RVM具體評論:

#ruby=1.9.3-p385 
+0

啊, 謎團已揭開。所以我收集它也讀了'ruby'1.9.3'行,因爲這是我在Gemfile中唯一的東西。這裏最好的路線是什麼? a)爲該版本的ruby安裝bundler gem,b)以某種方式禁用此功能,以便全局gemset也被加載,c)添加rvmrc,d)...? – lobati 2013-02-22 00:49:34