gpt4 book ai didi

ruby-on-rails-3 - 找不到生成器 acts_as_taggable_migration

转载 作者:行者123 更新时间:2023-12-01 11:56:35 26 4
gpt4 key购买 nike

在我的 rails3 应用程序中,我通过命令“rails plugin install acts_taggable_on_steroids”安装了 acts_as_taggable_on_steroids 并且它已安装,但现在迁移给我带来了问题。

我运行“rails generate acts_as_taggable_migration”,但出现错误“找不到生成器acts_as_taggable_migration”,请帮忙

最佳答案

设法通过 3 个步骤找出解决方法:

1) <b>$ rails generate migration acts_as_taggable</b><br/>



<pre><code> invoke active_record
create db/migrate/20110710214842_acts_as_taggable.rb
</code></pre>

2) 用迁移信息覆盖
$ cat lib/ruby/gems/1.8/gems/acts_as_taggable_on_steroids-1.2/generators/acts_as_taggable_migration/templates/migration.rb > 20110710223844_acts_as_taggable_migration.rb

3) 迁移


<b>$ rake db:migrate</b>
(in c:/Sites/bon)
== ActsAsTaggable: migrating =================================================
== ActsAsTaggable: migrated (0.0000s) ========================================

== ActsAsTaggableMigration: migrating ========================================
-- create_table(:tags)
-> 0.0020s
-- create_table(:taggings)
-> 0.0010s
-- add_index(:taggings, :tag_id)
-> 0.0010s
-- add_index(:taggings, [:taggable_id, :taggable_type])
-> 0.0010s
== ActsAsTaggableMigration: migrated (0.0140s) ===============================

<b>$ rake db:migration:status</b> 验证

关于ruby-on-rails-3 - 找不到生成器 acts_as_taggable_migration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6532331/

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