heroku db:推敲错了红宝石

时间:2012-08-25 00:21:55

标签: ruby-on-rails heroku

我正在使用OSX Mountain Lion并试图db:push。

$ 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://root@127.0.0.1/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/ruby-1.9.2-p320@lpr31/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和tap。我删除了ruby的内置版本的任何痕迹(我认为)。

2 个答案:

答案 0 :(得分: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:拉再次工作。

答案 1 :(得分:0)

因为您尝试使用bundle exec heroku。仅使用heroku代替,应该修复它。

如果要将Heroku CLI使用的Ruby设置为您使用RVM指定的Ruby,请参阅我的答案:https://stackoverflow.com/a/28632883/380607