【发布时间】:2011-08-09 02:16:08
【问题描述】:
所以我在第 239 页“使用 Rails 进行敏捷 Web 开发,第 4 版”。我的浏览器中有一个指向 localhost:3000 的选项卡,它工作正常。另一个选项卡指向“depot.thefonso.com”,我收到此错误:
"ActiveRecord::StatementInvalid in StoreController#index"
SQLite3::SQLException: no such table: products: SELECT "products".* FROM "products" ORDER BY title
Rails.root:/Users/gideon/Desktop/Rails_work/depot
...
app/controllers/store_controller.rb:7:in `index'
这里是 store_controller.rb 中的第 7 行....
@products = Product.all
有哪位大师能指出我正确的方向吗?
这是我的database.yml
# SQLite version 3.x
# gem install sqlite3
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
【问题讨论】:
标签: ruby-on-rails ruby