2012-08-25 75 views
1

我使用OSX Mountain Lion並嘗試db:push。heroku db:推動錯誤的紅寶石

$ ruby -v 
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin12.0.0] 
$ bundle exec heroku db:push --confirm ancient-falls-9918 
Loaded Taps v0.3.24 
Auto-detected local database: mysql2://[email protected]/lottery_portal_development?encoding=utf8 
Warning: Data in the app 'ancient-falls-9918' will be overwritten and will not be recoverable. 
/Users/psmy/.rvm/gems/[email protected]/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: [BUG] Segmentation fault 
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0] 

Abort trap: 6 

爲什麼它試圖使用1.8.7?

$ rvm list 

rvm rubies 

ree-1.8.7-2011.03 [ i686 ] 
=* ruby-1.9.2-p320 [ x86_64 ] 
ruby-1.9.3-p194 [ x86_64 ] 

我已經卸載和重新安裝的Heroku,並在項目和全球層面都水龍頭。我已經刪除了內置版本的紅寶石(我認爲)的任何痕跡。

+0

你找到這個答案? – Tony

+0

@Tony是的,看我的答案:http://stackoverflow.com/a/28634088/380607 – Magne

回答

0

聲明:這可能會或可能不會破壞的東西。這是我爲解決問題所做的。

試試這個solution.

卸載RVM:

rvm implode 
sudo rm -r ~/.rvm 

安裝rbenv

brew update 
brew install rbenv 
brew install ruby-build 
rbenv install 1.9.3-p194 
rbenv global 1.9.3-p194 

添加到您的〜/ .bash_profile中或〜/ .zshrc

eval "$(rbenv init -)" 

安裝捆綁

sudo gem install bundler 

安裝寶石

bundle install 

重新安裝Heroku Toolbelt

關閉所有終端窗口,並重新打開它們。我做了所有的和db:pull再次工作。

+0

但是...如果我想rvm? – phil

+0

這是我現在可以找到的唯一解決方案。祝你好運。 – mike