{"id":1654,"date":"2007-05-11T00:12:26","date_gmt":"2007-05-10T16:12:26","guid":{"rendered":"http:\/\/ihower.idv.tw\/blog\/archives\/1654"},"modified":"2015-09-05T10:57:24","modified_gmt":"2015-09-05T02:57:24","slug":"rails-on-cygwin-mac-like-development-environment","status":"publish","type":"post","link":"https:\/\/ihower.tw\/blog\/1654-rails-on-cygwin-mac-like-development-environment","title":{"rendered":"Rails on Cygwin \u4e4bMac-like\u958b\u767c\u74b0\u5883"},"content":{"rendered":"<p>Update(2007\/7\/3): Midnight Blog\u00a0\u7684 <a href=\"http:\/\/blog.pbg4.org\/2007\/5\/27\/rails-on-cygwin-2\">Rails on Cygwin #2<\/a> \u8ddf <a href=\"http:\/\/blog.pbg4.org\/2007\/5\/27\/rails-on-cygwin-1\">Rails on Cygwin #1<\/a>\u00a0\u9019\u5169\u7bc7\u63d0\u4f9b\u4e0d\u9700\u8981 complie MySQL \u7684\u65b9\u6cd5\uff0c\u503c\u5f97\u4e00\u8a66\u3002<\/p>\n<p>Update(2007\/5\/12): \u88dd<a href=\"http:\/\/mongrel.rubyforge.org\/index.html\"> Mongrel <\/a>\u4e5f\u6c92\u554f\u984c\u5594\uff0c\u6bd4Webrick\u597d\u7528\u591a\u4e86\u3002\u8a18\u5f97\u9078 ruby \u7248\u800c\u4e0d\u662f win32\u7248\u3002<\/p>\n<p>\u4e3b\u8981\u662f\u53c3\u8003\u9019\u7bc7 <a href=\"http:\/\/garbageburrito.com\/blog\/entry\/391\/a-macesque-rails-development-environment-on-windows\">A Mac-esque Rails Development Environment on Windows<\/a>\uff0c\u5728 Windows\u4e0a\u6253\u9020\u985e\u4f3c Mac\u4e0a\u7684\u00a0Rails \u958b\u767c\u74b0\u5883\u3002<\/p>\n<p>1.\u88dd E-TextEditor<\/p>\n<p>2.\u88dd cygwin\uff0c\u8a18\u5f97 Package \u8981\u6709 Ruby\u3001gcc\u8ddfmake\u3002\u4e4b\u5f8c\u5fd8\u4e86\u88dd\u4ec0\u9ebc\u6c92\u95dc\u4fc2\uff0c\u518d\u8dd1\u4e00\u904dsetup.exe\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>3.\u88dd <a href=\"http:\/\/sourceforge.net\/projects\/console\/\">Console<\/a>\uff0c\u4e00\u5957\u6709 tabs \u53ef\u4ee5\u5207\u63db\u4e0d\u540c\u8996\u7a97\u7684\u00a0command prompt\uff0c\u9664\u4e86\u53ef\u4ee5\u8dd1 windows\u7684cmd\uff0c\u7576\u7136\u4e5f\u53ef\u4ee5\u8dd1 cygwin\u7684bash shell\uff0c\u9084\u53ef\u4ee5\u8a2d\u5b9a\u80cc\u666f\u534a\u900f\u660e\u5594\u3002\u4e0d\u77e5\u9053\u70ba\u4ec0\u9ebc\u7248\u672c\u5f88\u591a\uff0c\u6211\u662f\u88dd Console-2.00b123-Beta \u6700\u6c92\u554f\u984c\u3002<\/p>\n<p>\u88dd\u597d\u5f8c\u5728 Settings \u65b0\u589e\u4e00\u500b tab shell \u57f7\u884c C:\\cygwin\\cygwin.bat \u5373\u53ef\u3002<\/p>\n<ol>\n<li>\u88dd Ruby Gems\uff0c\u4e0b\u8f09 <a target=\"_blank\" href=\"http:\/\/rubyforge.org\/frs\/?group_id=126&amp;release_id=9501\">rubyforge.org\/frs\/?group_id=126&#038;release_id=9501<\/a>\uff0c\u89e3\u58d3\u7e2e\u5f8c\u57f7\u884c ruby setup.rb\u3002 (\u6ce8\u610f\u9019\u662f\u7d66 cygwin \u7684\uff0c\u6703\u88dd\u5728 \/usr\/\u4e0b\uff0c\u8ddf\u4f60\u88ddwindows\u7248Ruby\u5728 C:\/Ruby\/\u662f\u5169\u56de\u4e8b)<\/li>\n<\/ol>\n<p>5.\u88dd Rails\uff0cgem install rails &#8211;include-dependencies<\/p>\n<p>5.\u88dd\u8cc7\u6599\u5eab\uff0ccomplie \u5669\u5922\u7684\u958b\u59cb&#8230;:p \u6211\u53c3\u8003\u4e86 <a href=\"http:\/\/wiki.rubyonrails.org\/rails\/pages\/RailsonWindowsCygwin\">RailsonWindowsCygwin<\/a>\u00a0 \u8ddf <a href=\"http:\/\/wiki.rubyonrails.org\/rails\/pages\/RailsOnWindowsCygwinWithSQLite3\">RailsOnWindowsCygwinWithSQLite3<\/a>\uff0c\u628a source code \u4e0b\u8f09\u5230 cygwin \u4e0a\uff0c\u7136\u5f8c configure \u8ddf make\uff0c\u9019\u53ef\u8b93\u6211\u5c0f\u5c0f\u7684NB\u8dd1\u4e86\u597d\u5e7e\u500b\u9418\u982d\u3002<\/p>\n<p>Sqlite3 \u6bd4\u8f03\u6c92\u554f\u984c(\u7167\u8457\u505a\u5373\u53ef)\u3002MySQL\u7684\u8a71\u975e\u5e38\u795e\u5947\uff0c\u96d6\u7136\u4f60\u771f\u6b63\u662f\u8981\u7528 MySQL windows \u7248(\u5e38\u99d0\u6210\u670d\u52d9)\uff0c\u4f46\u662f\u70ba\u4e86\u5728 Cygwin \u4e0a\u53ef\u4ee5 work\uff0c\u4f60\u5728 Cygwin \u4e0a\u4e5f\u5fc5\u9808\u88dd (\u4f46\u4e0d\u7528\u555f\u52d5 mysql.server)\u3002\u6211\u78b0\u5230\u7684\u554f\u984c\u662f\u5728 cygwin \u4e2d\u9023 localhost \u6703\u9023\u5230 cygwin \u7684 MySQL \u800c\u4e0d\u662f windows \u7684 MySQL\uff0c\u62dc\u904eG\u793e\u5927\u795e\u5f8c\uff0c\u627e\u5230\u7684<a href=\"http:\/\/blog.labnotes.org\/2005\/11\/06\/setting-up-ruby-gems-on-cygwin\/\">\u89e3\u6cd5<\/a>\u975e\u5e38\u7c21\u55ae\uff0c\u53ea\u8981\u6539\u9023 127.0.0.1\u5373\u53ef (rails \u7684\u00a0database.yaml \u628a localhost \u6539\u6210 127.0.0.1 )\u3002<\/p>\n<p>\u81f3\u6b64\u5927\u529f\u544a\u6210\uff0c\u6210\u529f\u5728 cygwin\u4e0a\u57f7\u884c ruby script\/server\u3002\u6700\u5f8c\u4e7e\u8106\u628a Ruby for win32 \u7248\u4e5f uninstall\u4e86\uff0c\u807d\u8aaa\u4e5f\u8a31\u6703\u6709\u885d\u7a81(?)\u3002<\/p>\n<p>\u7d42\u65bc\u6709\u984f\u8272\u6f02\u4eae\u53c8\u6709 auto-complete \u7684 unix shell \uff0c\u518d\u4e5f\u4e0d\u9700\u8981\u7528\u96e3\u7528\u7684 windows cmd \u5566&#8230;:)<\/p>\n<p><a href=\"\/blog\/wp-content\/uploads\/2007\/05\/console.jpg\" title=\"Console\"><img decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/2007\/05\/console.thumbnail.jpg\" alt=\"Console\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update(2007\/7\/3): Midnight Blog\u00a0\u7684 Rails on Cygwin #2 \u8ddf  &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ihower.tw\/blog\/1654-rails-on-cygwin-mac-like-development-environment\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008Rails on Cygwin \u4e4bMac-like\u958b\u767c\u74b0\u5883\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":[53,31,2],"tags":[],"class_list":["post-1654","post","type-post","status-publish","format-standard","hentry","category-rails","category-ruby","category-software-development","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1q6tG-qG","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1654","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=1654"}],"version-history":[{"count":3,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1654\/revisions"}],"predecessor-version":[{"id":8332,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/posts\/1654\/revisions\/8332"}],"wp:attachment":[{"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/media?parent=1654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/categories?post=1654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ihower.tw\/blog\/wp-json\/wp\/v2\/tags?post=1654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}