當前正在使用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