SQLite 是個輕量級的資料庫程式,因為我想在NB上寫Rails,但是又不想裝MySQL好重,第一個就想到SQLite。關於SQLite的中文介紹,可以參考 簡介SQLite 和 SQLite使用教學。基本上 sqlite 就是一隻 command-line 程式而已,再加上一個資料檔(即一個資料庫)。
要在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,也是一個檔案而已,不需要安裝。
分享到:
相关推荐
博文链接:https://tianshi0253.iteye.com/blog/229012
rails升级到2.0.2之后默认使用sqlite3作为数据库. 解压后把sqlite3.def、sqlite3.dll复制到Ruby安装目录bin文件夹下. 版本:sqlitedll-3_6_21
Deploying Rails with Docker, Kubernetes and ECS shows you how to set up the project, push it to DockerHub, manage services and set up an efficient continuous integration environment. Every concept is ...
If you’re an experienced developer, this book will give you the comprehensive, insider information you need., Rails has evolved over the years, and this book has evolved along with it. We still ...
Agile Web Development with Rails 3nd Edition beta
Agile Web Development with Rails 5 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书...
Ruby.on.Rails.Tutorial,Learn.Web.Development.with.Rails,Third.Edition-中文版 文字版.pdf 个人收集电子书,仅用学习使用,不可用于商业用途,如有版权问题,请联系删除!
(301.22 KiB) This ZIP archive contains a DLL ... The DLL is built using SQLITE_ENABLE_COLUMN_METADATA so that it is suitable for use with Ruby on Rails. (sha1: 60f9d4006fc70abac5567d1901daee8ccb3d36aa)
Agile Web Development with Rails
Agile Web Development with Rails (PDF)
docker-compose up --build -d tail -f log/development.log bundle lock --update执照版权所有@ Tatsuhiro Ujihisa GPLv3或任何更高版本
Deploying Rails with Docker, Kubernetes and ECS 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn...
Ruby+on+Rails+3+Tutorial.pdf 应用Rails进行敏捷Web开发第4版.pdf (Agile Web Development with Rails) Rails.Recipes.Rails.3.Edition.pdf
agile web development with rails 5(英文电子书).............................................................................................................................................................
(2)安装Rails3 gem install rails (3)安装sqlite3 gem install sqlite3-ruby 安装sqlite3时候会提示你从链接中下载sqlite3.dll到ruby安装目录的bin文件夹下! (4)安装mysql gem install mysql2 创建项目: rails ...
Agile Web Development With Rails 3rdEdition Beta
博文链接:https://jbf034.iteye.com/blog/219935