2010-11-26 1 views
4

Rails 3チュートリアルの作業を開始しましたので、フレームワークに精通していますが、schema.rbの生成に関する問題が発生しています。私のオペレーティングシステムはWindows 7 x64、Ruby 1.9.2、MySQL2 gem 0.2.6、Rails 3.0.3です。rake db:migrateを実行しているときにschema.rbが(正しく)生成されないのはなぜですか?

私は2つの作成した移行、私のリストに1つ持っている:

class CreateLists < ActiveRecord::Migration 
def self.up 
    create_table :lists do |t| 
    t.string :name 
    t.text :description 

    t.timestamps 
    end 
end 

def self.down 
    drop_table :lists 
    end 
end 

と私のリストの項目の1:

class CreateItems < ActiveRecord::Migration 
    def self.up 
    create_table :items do |t| 
     t.string :name 
     t.string :type 
     t.boolean :completed 
     t.references :list 

     t.timestamps 
    end 
    end 

    def self.down 
    drop_table :items 
    end 

end 

レーキが正常に移行し、アプリケーションが期待通りに動作しますが、schema.rb表示されるのは

ActiveRecord::Schema.define(:version => 20101126074332) do 

# Could not dump table "items" because of following ArgumentError 
# invalid date 

# Could not dump table "lists" because of following ArgumentError 
# invalid date 

誰でも、Railsでのアドバイス問題を引き起こしている可能性がありますか?グーグルは何も出てこなかった。

+1

をこれはおそらくあまり役​​に立ちませんが、私はWin7のx32のを使用して移行を試みたが、Rubyの1.9.2、Railsの3.0.3とsqlite3それはうまく働いたので、私はMySQL2の問題に私のお金を入れたいと思います。 – carols10cents

+0

SQLite3アダプタで正しくダンプされるので、あなたは完全に正しいと思われます。私のUbuntuボックスで、Windows固有の問題か、MySQLのインストールに問題があるかどうかを再確認します。 –

答えて

2

お試しrake db:schema:dump

+0

質問に表示されている出力と同じ結果になります。つまり、schema.rbを削除してdbを削除した後にrake db:migrateを実行します。 –

+0

Phewありがとう。何らかの理由でdb:structure:dumpは常にSQLモードを使用します – Kevin

関連する問題