要在Rails中使用,Windows 下首先去 SQLite 網站下載 執行檔 跟 DLL檔,即 sqlite3.exe 跟 sqlite3.dll,放到 C:/ruby/bin 下。FreeBSD的話,執行 /usr/ports/databases/sqlite3/make install。
接著安裝 sqlite for Ruby gem,執行 gem install sqlite3-ruby,Windows 下選擇 win32 ,FreeBSD下選 ruby 的版本。
最後設定 database.yml :
development:
adapter: sqlite3
dbfile: db/dev.db
test:
adapter: sqlite3
dbfile: db/test.db
production:
adapter: sqlite3
dbfile: db/prod.db
然後執行你寫好的 Migrations 即可把資料庫建立出來。
如果你想要 SQLite 的 GUI 管理介面,試試 SQLite Database Browser,也是一個檔案而已,不需要安裝。
381



被折叠的 条评论
为什么被折叠?



