0.1.13" 当我运行“rails generate wysihat”时,它会生成所有图像文件,但无法生成迁-6ren">
gpt4 book ai didi

ruby-on-rails - `next_migration_number' : NotImplementedError (NotImplementedError) using wysihat-engine in rails

转载 作者:行者123 更新时间:2023-12-04 18:12:18 31 4
gpt4 key购买 nike

我正在使用以下 gem 作为编辑器。

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

当我运行“rails generate 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>'

谢谢你的帮助!

最佳答案

我刚刚在 Rails 4.1.5 中遇到了这个问题

我通过在我的迁移中实现来修复它:

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

private
def self.next_migration_number(dirname)
next_migration_number = current_migration_number(dirname) + 1
ActiveRecord::Migration.next_migration_number(next_migration_number)
end
end

关于ruby-on-rails - `next_migration_number' : NotImplementedError (NotImplementedError) using wysihat-engine in rails,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11079617/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com