cassandra_helperが動かない(覚え書き)

Pocket

cassandra_helperを動かそうとするとこんなエラーメッセージが表示される。

$ cassandra_helper cassandra
/home/noguchi/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:900:in `report_activate_error': RubyGem version error: thrift(0.6.0 not ~> 0.5.0) (Gem::LoadError)
     from /home/noguchi/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `activate'
     from /home/noguchi/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:1276:in `gem'
     from /home/noguchi/.rvm/gems/ruby-1.8.7-p334/gems/cassandra-0.10.0/lib/cassandra.rb:2
     from /home/noguchi/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
     from /home/noguchi/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
     from /home/noguchi/.rvm/gems/ruby-1.8.7-p334/gems/cassandra-0.10.0/bin/cassandra_helper:5
     from /home/noguchi/.rvm/gems/ruby-1.8.7-p334/bin/cassandra_helper:19:in `load'
     from /home/noguchi/.rvm/gems/ruby-1.8.7-p334/bin/cassandra_helper:19

バージョンを指定してthriftをインストール

thriftのバージョンが合っていないらしいので0.5系を入れる。

$ gem install thrift --version '0.5'
Fetching: thrift-0.5.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed thrift-0.5.0
1 gem installed
Installing ri documentation for thrift-0.5.0...

Enclosing class/module 'thrift_module' for class BinaryProtocolAccelerated not known

Enclosing class/module 'thrift_module' for class BinaryProtocolAccelerated not known
Installing RDoc documentation for thrift-0.5.0...

Enclosing class/module 'thrift_module' for class BinaryProtocolAccelerated not known

Enclosing class/module 'thrift_module' for class BinaryProtocolAccelerated not known

それでもthriftのバージョンが合っていない

0.6.0のthriftが有効になってるので0.5.0が動かせない。

$ cassandra_helper cassandra
/home/noguchi/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:268:in `activate': can't activate thrift (~> 0.5.0) for [], already activated thrift-0.6.0 for [] (Gem::LoadError)
     from /home/noguchi/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:1276:in `gem'
     from /home/noguchi/.rvm/gems/ruby-1.8.7-p334/gems/cassandra-0.10.0/lib/cassandra.rb:2
     from /home/noguchi/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
     from /home/noguchi/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
     from /home/noguchi/.rvm/gems/ruby-1.8.7-p334/gems/cassandra-0.10.0/bin/cassandra_helper:5
     from /home/noguchi/.rvm/gems/ruby-1.8.7-p334/bin/cassandra_helper:19:in `load'
     from /home/noguchi/.rvm/gems/ruby-1.8.7-p334/bin/cassandra_helper:19

バージョンの共存のさせ方が不明だっったため、thrift0.6.0を強制アンインストール

$ gem uninstall thrift --version '0.6.0'

You have requested to uninstall the gem:
     thrift-0.6.0
thrift_client-0.6.2 depends on [thrift (~> 0.6.0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]  y
Successfully uninstalled thrift-0.6.0

これでcassandra_helperが動くようになった。

投稿者紹介

株式会社ユニキャスト
私たちは、テクノロジに魅せられた個性あふれるメンバーによって構成された茨城県日立市に本社を構えるベンチャー企業です。
”テクノロジを通して「驚き」と「感動」を創造し、人々の「夢」と「笑顔」を支えます。” の経営理念をモットーに明るい未来を描き、ワクワクする企画提案を続けて参ります。

1件のコメント

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください