当前正在使用rails项目。当我试图启动rails服务器抛出以下错误:Ruby on Rails - 错误正在运行的服务器
=> Booting WEBrick
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/var/lib/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/connection_adapters
/sqlite_adapter.rb:439:in `table_structure': Could not find table 'dbrick'
(ActiveRecord::StatementInvalid)
我的表名是'dbrick'。我也试图耙db:drop和rake db:mirgrate。虽然迁移其抛出以下错误:
rake aborted!
Could not find table 'dbrick'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
这是我的迁移文件:
class CreateDbricks < ActiveRecord::Migration
def self.up
create_table :dbricks do |t|
t.text :description
t.string :video
t.string :video_html
t.string :image_id
t.string :option_id
t.boolean :choice
t.string :reach
t.integer :category_id
t.string :user_id
t.datetime :deleted_at
t.timestamps
end
end
def self.down
drop_table :dbricks
end
end
这将是这么多的帮助充满如果任何人帮我出这一点。 在此先感谢。
尝试'rake db:schema:load'? – Trip 2012-08-02 10:23:54
你有一个错字:迁移创建'dbricks',但代码尝试使用'dbrick'表。 (复数与单数形式) – 2012-08-02 13:09:40
感谢您的回复。雅我试过耙db:架构:加载,但它给出了相同的错误,即耙中止! 找不到表“dbrick” 任务:TOP =>分贝:迁移=>环境 (请参阅通过运行带有--trace任务全部跟踪) – Abhiram 2012-08-02 15:02:40