Search code examples
ruby-on-rails-3ruby-on-rails-3.1bundler

undefined local variable or method `index' for #<Bundler::Definition


Every thing was working fine and once I logout and login back to my system, nothing works for Rails 3.1 on my system. On every app it throws the same error:

/home/nazar2/.rvm/gems/ruby-1.9.2-p290@rails3.1/gems/bundler-1.0.21/lib/bundler/definition.rb:151:in `resolve': undefined local variable or method `index' for #<Bundler::Definition:0x97a48d4> (NameError)
    from /home/nazar2/.rvm/gems/ruby-1.9.2-p290@rails3.1/gems/bundler-1.0.21/lib/bundler/definition.rb:90:in `specs'
    from /home/nazar2/.rvm/gems/ruby-1.9.2-p290@rails3.1/gems/bundler-1.0.21/lib/bundler/definition.rb:135:in `specs_for'
    from /home/nazar2/.rvm/gems/ruby-1.9.2-p290@rails3.1/gems/bundler-1.0.21/lib/bundler/definition.rb:124:in `requested_specs'
    from /home/nazar2/.rvm/gems/ruby-1.9.2-p290@rails3.1/gems/bundler-1.0.21/lib/bundler/environment.rb:23:in `requested_specs'
    from /home/nazar2/.rvm/gems/ruby-1.9.2-p290@rails3.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:11:in `setup'
    from /home/nazar2/.rvm/gems/ruby-1.9.2-p290@rails3.1/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'
    from /home/nazar2/.rvm/gems/ruby-1.9.2-p290@rails3.1/gems/bundler-1.0.21/lib/bundler/setup.rb:7:in `<top (required)>'
    from /home/nazar2/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
    from /home/nazar2/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
    from /home/nazar2/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /home/backup/Hub/clients/orthomind/new/orthomind/config/boot.rb:6:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from script/rails:5:in `<main>'

I am stuck and can't figure out what the issue is.


Solution

  • Just updated to bundler gem and every things works perfectly fine.

    gem install bundler --pre
    

    I think there was some issue with previous bundler gem version with Rails3.1