{"id":1452,"date":"2006-08-13T08:42:16","date_gmt":"2006-08-13T00:42:16","guid":{"rendered":"http:\/\/ihower.idv.tw\/blog\/archives\/1452"},"modified":"2008-09-29T01:09:45","modified_gmt":"2008-09-28T17:09:45","slug":"rails-with-sqlite-windows","status":"publish","type":"post","link":"https:\/\/ihower.tw\/blog\/1452-rails-with-sqlite-windows","title":{"rendered":"Rails with SQLite"},"content":{"rendered":"<p><a href=\"http:\/\/www.sqlite.org\/index.html\"><img decoding=\"async\" src=\"http:\/\/www.sqlite.org\/sqlite.gif\" style=\"margin: 5px; border: 0px\" \/><\/a><\/p>\n<p>SQLite \u662f\u500b\u8f15\u91cf\u7d1a\u7684\u8cc7\u6599\u5eab\u7a0b\u5f0f\uff0c\u56e0\u70ba\u6211\u60f3\u5728NB\u4e0a\u5bebRails\uff0c\u4f46\u662f\u53c8\u4e0d\u60f3\u88ddMySQL\u597d\u91cd\uff0c\u7b2c\u4e00\u500b\u5c31\u60f3\u5230SQLite\u3002\u95dc\u65bcSQLite\u7684\u4e2d\u6587\u4ecb\u7d39\uff0c\u53ef\u4ee5\u53c3\u8003 <a href=\"http:\/\/www.dev.idv.tw:8080\/folder.2005-02-27.6191275545\/folder.2005-02-14.5124708507\/folder.2005-02-14.1222121317\/document.2005-02-26.6676749468\">\u7c21\u4ecbSQLite<\/a>\u00a0\u548c\u00a0<a href=\"http:\/\/openvanilla.org\/wiki\/zh\/index.php?title=SQLite%E4%BD%BF%E7%94%A8%E6%95%99%E5%AD%B8\">SQLite\u4f7f\u7528\u6559\u5b78<\/a>\u3002\u57fa\u672c\u4e0a\u00a0sqlite \u5c31\u662f\u4e00\u96bb command-line \u7a0b\u5f0f\u800c\u5df2\uff0c\u518d\u52a0\u4e0a\u4e00\u500b\u8cc7\u6599\u6a94(\u5373\u4e00\u500b\u8cc7\u6599\u5eab)\u3002<\/p>\n<p>\u8981\u5728Rails\u4e2d\u4f7f\u7528\uff0cWindows \u4e0b\u9996\u5148\u53bb <a href=\"http:\/\/www.sqlite.org\/index.html\">SQLite <\/a>\u7db2\u7ad9\u4e0b\u8f09 \u57f7\u884c\u6a94 \u8ddf DLL\u6a94\uff0c\u5373 sqlite3.exe \u8ddf sqlite3.dll\uff0c\u653e\u5230 C:\/ruby\/bin \u4e0b\u3002FreeBSD\u7684\u8a71\uff0c\u57f7\u884c \/usr\/ports\/databases\/sqlite3\/make install\u3002<\/p>\n<p>\u63a5\u8457\u5b89\u88dd sqlite for Ruby gem\uff0c\u57f7\u884c gem install sqlite3-ruby\uff0cWindows \u4e0b\u9078\u64c7 win32 \uff0cFreeBSD\u4e0b\u9078 ruby \u7684\u7248\u672c\u3002<\/p>\n<p>\u6700\u5f8c\u8a2d\u5b9a database.yml :<\/p>\n<blockquote><p>development:<br \/>\n\u00a0 adapter: sqlite3<br \/>\n\u00a0 dbfile: db\/dev.db<\/p>\n<p>test:<br \/>\n\u00a0 adapter: sqlite3<br \/>\n\u00a0 dbfile: db\/test.db<\/p>\n<p>production:<br \/>\n\u00a0 adapter: sqlite3<br \/>\n\u00a0 dbfile: db\/prod.db<\/p><\/blockquote>\n<p>\u7136\u5f8c\u57f7\u884c\u4f60\u5beb\u597d\u7684 <a href=\"http:\/\/ihower.idv.tw\/blog\/archives\/1436\">Migrations<\/a>\u00a0\u5373\u53ef\u628a\u8cc7\u6599\u5eab\u5efa\u7acb\u51fa\u4f86\u3002<\/p>\n<p>\u5982\u679c\u4f60\u60f3\u8981 SQLite \u7684 GUI \u7ba1\u7406\u4ecb\u9762\uff0c\u8a66\u8a66 <a href=\"http:\/\/sourceforge.net\/projects\/sqlitebrowser\/\">SQLite Database Browser<\/a>\uff0c\u4e5f\u662f\u4e00\u500b\u6a94\u6848\u800c\u5df2\uff0c\u4e0d\u9700\u8981\u5b89\u88dd\u3002<\/p>\n<p>\u53c3\u8003\u8cc7\u6599 :<\/p>\n<ul>\n<li><a href=\"http:\/\/openvanilla.org\/wiki\/zh\/index.php?title=SQLite%E4%BD%BF%E7%94%A8%E6%95%99%E5%AD%B8\">SQLite\u4f7f\u7528\u6559\u5b78<\/a><\/li>\n<li><a href=\"http:\/\/www.dev.idv.tw:8080\/folder.2005-02-27.6191275545\/folder.2005-02-14.5124708507\/folder.2005-02-14.1222121317\/document.2005-02-26.6676749468\">\u7c21\u4ecbSQLite<\/a><\/li>\n<li>Rails Wiki: <a href=\"http:\/\/wiki.rubyonrails.com\/rails\/pages\/HowtoUseSQLite\">HowtoUseSQLite<\/a><\/li>\n<li><a href=\"http:\/\/www.sqlite.org\/index.html\">SQLite<\/a><\/li>\n<li><a href=\"http:\/\/sourceforge.net\/projects\/sqlitebrowser\/\">SQLite Database Browser<\/a><\/li>\n<li><a href=\"http:\/\/www.rubyonrailsblog.com\/articles\/2006\/08\/28\/sqlite-for-ruby-on-rails-applications-revisited\">SQLite for Ruby on Rails <\/a>\u00a0(\u512a\u7f3a\u9ede\u5206\u6790)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>SQLite \u662f\u500b\u8f15\u91cf\u7d1a\u7684\u8cc7\u6599\u5eab\u7a0b\u5f0f\uff0c\u56e0\u70ba\u6211\u60f3\u5728NB\u4e0a\u5bebRails\uff0c\u4f46\u662f\u53c8\u4e0d\u60f3\u88ddMySQL\u597d\u91cd\uff0c\u7b2c\u4e00\u500b\u5c31\u60f3\u5230S &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ihower.tw\/blog\/1452-rails-with-sqlite-windows\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008Rails with SQLite\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[38,5,53],"tags":[],"class_list":["post-1452","post","type-post","status-publish","format-standard","hentry","category-database","category-programming","category-rails","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1q6tG-nq","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/comments?post=1452"}],"version-history":[{"count":0,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1452\/revisions"}],"wp:attachment":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/media?parent=1452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/categories?post=1452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/tags?post=1452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}