所以我在第239页的“用rails第四版的敏捷web开发”。我的浏览器中有一个指向localhost:3000的选项卡,它工作正常。另一个标签是指向 “depot.thefonso.com”,我得到这个错误:ActiveRecord :: StatementInvalid StoreController#index
“的ActiveRecord :: StatementInvalid在StoreController#指数”
的SQLite3 ::的SQLException:没有这样的表:产品:选择“产品” * FROM “产品” ORDER BY标题
Rails.root:/用户/吉迪恩/桌面/ Rails_work /车厂
...
应用程序/控制器/ store_controller.rb:7: `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
嗯,我有pdf版本,并且“cap deploy:migrations”没有从本章的开头(235)列出到页码240 ... no提及它。好奇。 – thefonso
如果您要通过PDF页码,然后继续前进! :-)下一步是设置你的数据库。 –
我现在在第142页(pdf版本)我在“与Capistrano远程部署”。在我的gemfile中使用'mysql2','0.2.7'并将mysql更改为database.yml中的mysql2后,我能够无误地运行命令“rake db:setup RAILS_ENV =”production“”。几乎......它告诉我“depot_production已经存在”,但是按照pdf文本第241页的说明进行操作。只是踢我跑你提到的两个命令的架构。 “sqlite3 db/production.db .schema”什么都没产生......只是一片空白。第一个命令产生输出。 – thefonso