2012年5月28日月曜日

instagram-ruby-gem の undefined method `configure' for Instagram:Module (NoMethodError)

instagram-ruby-gem を bundle install後、rails sで起動したら、以下のエラーが起きたのでメモ。


/config/initializers/instagram.rb:5:in `<top (required)>': undefined method `configure' for Instagram:Module (NoMethodError)


Gemfile


gem 'instagram'


と記述して


$bundle install


$rails s


で起動。


/config/initializers/instagram.rb:5:in `<top (required)>': undefined method `configure' for Instagram:Module (NoMethodError)


のエラー


ググる。


https://github.com/Instagram/instagram-ruby-gem/issues/21


こちらがヒット。


Gemfile


gem 'instagram', :git => 'git://github.com/Instagram/instagram-ruby-gem.git'


と記述して


$ bundle install

Updating git://github.com/Instagram/instagram-ruby-gem.gitFetching gem metadata from https://rubygems.org/.......Fetching gem metadata from https://rubygems.org/..Bundler could not find compatible versions for gem "multi_json": In snapshot (Gemfile.lock): multi_json (1.3.4)

In Gemfile: instagram (>= 0) ruby depends on multi_json (~> 1.0.3) ruby

Running `bundle update` will rebuild your snapshot from scratch, using onlythe gems in your Gemfile, which may resolve the conflict.

今度はgemどうしで喧嘩。

https://github.com/kylefox/instagram-ruby-gem/commit/95dbe0af2bfe1061aa757bf88726370ccb475ce4

これ読み込んだりこれように、forkなどして変更したがダメ。

とりあえず、gemなおしてgem 'instagram', :git => 'git://github.com/Instagram/instagram-ruby-gem.git'

なんとなく In snapshot (Gemfile.lock):ってあるから、これ全部消して

$bundle install

...

...Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

!! できた!?

$rails s

動いた!!よくわからけど、これで喧嘩収まることもあるらしいです。



ちなみで、https://github.com/mshk/Instagram-on-Rails-Sample

を参考にして、appは作ってったー






0 件のコメント:

コメントを投稿