2012-06-18 3 views
3

Я использую следующий камень для редактора.`next_migration_number ': NotImplementedError (NotImplementedError) с использованием wysihat-engine в rails

gem "wysihat-engine", "~> 0.1.13" 

Когда я бегу «рельсы генерировать wysihat» это генерировать весь файл изображения, но не может произвести миграцию и дает следующие ошибки

c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/generators/migration.rb:30:in `next_migration_number': NotImplementedError (NotImplementedError) 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/generators/migration.rb:49:in `migration_template' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/wysihat-engine-0.1.13/lib/generators/wysihat_generator.rb:60:in `install_wysihat' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.14.6/lib/thor/task.rb:22:in `run' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.14.6/lib/thor/base.rb:389:in `start' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/generators.rb:170:in `invoke' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands/generate.rb:12:in `<top (required)>' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' 
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:29:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 

Спасибо за любую помощь!

ответ

0

использовать ActiveRecord :: Generators :: Base вместо. (возможно, обновление до последней версии вашего драгоценного камня).

5

Я просто побежал в этой проблеме с Rails 4.1.5

Я установил его реализации в моей миграции

class MigrationGenerator < ::Rails::Generators::Base 
    include Rails::Generators::Migration 

    def self.next_migration_number(dir) 
    Time.now.utc.strftime("%Y%m%d%H%M%S") 
    end 
end 

так что это немного рубить. Я не могу найти никаких документов о том, каким должен быть официальный путь, или почему это даже проблема.

0
require 'rails/generators/active_record' 
class YourGenerator < ActiveRecord::Generators::Base 
    # save you from `next_migration_number': NotImplementedError and undefined method `migration_template' 
end 
Смежные вопросы