Q:

Rails Generate command error

I am using Rails version 4.2.7.1 and ruby 2.2.5 with rvm.
After bundle update I cannot run rails g command anymore.
The following error keeps appearing:
-- [](4.2)
/Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:664:in `block in method_missing': undefined method `[]' for #<ActiveRecord::Migration:0x007fce8f996460> (NoMethodError)
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `block in say_with_time'
    from /Users/Sergei/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/benchmark.rb:288:in `measure'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `say_with_time'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:654:in `method_missing'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:416:in `method_missing'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/encrypted_store-0.3.0/lib/generators/encrypted_store/upgrade/ZeroOneFive/templates/upgrade_encryption_keys_to_015.rb:1:in `<top (required)>'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/encrypted_store-0.3.0/lib/encrypted_store/railtie.rb:18:in `block (2 levels) in <class:Railtie>'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/encrypted_store-0.3.0/lib/encrypted_store/railtie.rb:18:in `each'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/encrypted_store-0.3.0/lib/encrypted_store/railtie.rb:18:in `block in <class:Railtie>'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/railtie.rb:228:in `call'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/railtie.rb:228:in `block in run_generators_blocks'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/railtie.rb:245:in `each'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/railtie.rb:245:in `each_registered_block'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/railtie.rb:228:in `run_generators_blocks'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/application.rb:462:in `block in run_generators_blocks'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/engine/railties.rb:13:in `each'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/engine/railties.rb:13:in `each'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/application.rb:462:in `run_generators_blocks'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/engine.rb:461:in `load_generators'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:129:in `generate_or_destroy'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:50:in `generate'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

Already tried reinstalling gemset and deleting all previous migration files, but it did not help. What could be the reason?

A:

OK! I solved by myself. As I could see from this line
from /Users/Sergei/.rvm/gems/ruby-2.2.5@rails4/gems/encrypted_store-0.3.0/lib/generators/encrypted_store/upgrade/ZeroOneFive/templates/upgrade_encryption_keys_to_015.rb:1:in `<top (required)>'

It had dependency from gem encrypted_store. I removed this gem from Gemfile and reinstalled in with bundle command (gem 'encrypted_store', '~> 0.2.8'). After this the error was gone.

