我无法在我的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
我尝试安装rake = 0.8.7,设置我的rails项目的Gemfile使用rake = 0.8.7,但我仍然得到相同的“uknown type”错误。
迁移文件:
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 :(得分:0)
根据this post by Mark Aufflick,可能是因为你安装了Ruby。
我建议卸载Ruby,然后使用RVM重新安装它。
答案 1 :(得分:0)
你试过了吗?
> bundle exec rake db:migrate