rails:2403
From: osamu OHSHIMA <ohshima@p...>
Date: Thu, 11 Oct 2007 11:51:49 +0900 (JST)
Subject: [rails:2403] create_tables methodが定義されていない!?
大島と申します。
非常に初歩的な質問で申し訳ありません。
create_tablesメソッドがないというエラーが出るのですが、何が原因でしょうか。
あまりに初歩的過ぎるのでしょうか「Web全体で」ググっても該当するものがありません。
<状況>
まずマイグレーションファイルを作って
$ rake db:migrate
とすると
(in /home/shinro/temp/kyouin)
== CreateKyouins: migrating ===================================================
-- create_tables(:kyouins)
rake aborted!
undefined method `create_tables' for
#<ActiveRecord::ConnectionAdapters::MysqlAdapter:0xb763eff4>
というエラーが出ます。
# locate mysql_adapter.rb
で該当のメソッドを探すと
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb
/usr/share/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
があり、その中にはちゃんと
def create_table(name, options = {}) #:nodoc:
super(name, {:options => "ENGINE=InnoDB"}.merge(options))
end
と定義されています。
使っている環境は次のとおりです。
Ruby version 1.8.6 (i686-linux)
RubyGems version 0.9.4
Rails version 1.2.3
Active Record version 1.15.3
Action Pack version 1.13.3
Action Web Service version 1.2.3
Action Mailer version 1.3.3
Active Support version 1.4.2
Application root /home/shinro/temp/kyouin
Environment development
Database adapter mysql
Database schema version 0
GetText version 1.10.0
-----
ohshima@p...
--
ML: rails@r...
使い方: http://QuickML.com/
2402 2007-10-11 04:11 [ikedak@r... ] 参加します -> 2403 2007-10-11 04:51 ┗[ohshima@p... ] create_tables methodが定義されていない!? 2404 2007-10-11 05:17 ┣[bsdmad@g... ] 2407 2007-10-11 05:59 ┃┗[ohshima@p... ] 2408 2007-10-11 06:04 ┃ ┗[bsdmad@g... ] 2405 2007-10-11 05:18 ┣[xxshss@y... ] 2406 2007-10-11 05:20 ┣[naoki.ts@g... ] 2409 2007-10-11 06:17 ┗[y-yamasaki@s... ]