耙“未知类型”错误

问题描述:

我不能在我的rails项目上运行rake db:migrate。我得到这个错误:耙“未知类型”错误

/home/john/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.5/lib/active_record/connection_adapters/sqlite3_adapter.rb:27: [BUG] unknown type 0x22 (0xc given) 
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux] 
... 
# several lines of traceback here 
... 
[NOTE] 
You may have encountered a bug in the Ruby interpreter or extension libraries. 
Bug reports are welcome. 
For details: http://www.ruby-lang.org/bugreport.html 

[1] 2610 abort  rake db:migrate 

full traceback

我试着安装耙= 0.8.7,设置我的Rails项目的Gemfile中使用耙= 0.8.7,但我仍然得到同样的“未知类型“错误。

迁移文件:

class CreateProducts < ActiveRecord::Migration 
    def self.up 
    create_table :products do |t| 
     t.string :title 
     t.text :description 
     t.string :image_url 
     t.decimal :price, :precision => 8, :scale => 2 

     t.timestamps 
    end 
    end 

    def self.down 
    drop_table :products 
    end 
end 
+0

你可以发布你的迁移文件吗?看起来你正在Ruby 1.9.2上运行Rails 3.0.5。正确? – 2012-01-03 05:59:59

+0

是的,Rails 3.0.5。我正在阅读一本书,它使用3.0.5。 – john2x 2012-01-03 06:41:08

this post by Mark Aufflick,它可能是由于你如何安装了Ruby。

我会建议卸载Ruby,然后使用RVM重新安装它。

+0

我正在使用RVM ..'$哪个rake'返回'/ home/john/.rvm/gems/ruby​​-1.9.2-p290/bin/rake' – john2x 2012-01-03 06:37:27

你试过:

> bundle exec rake db:migrate