{"id":405,"date":"2011-11-12T13:21:09","date_gmt":"2011-11-12T19:21:09","guid":{"rendered":"https:\/\/www.ppsstudios.com\/blog\/?p=405"},"modified":"2018-08-07T11:14:08","modified_gmt":"2018-08-07T17:14:08","slug":"ruby-on-rails-for-windows","status":"publish","type":"post","link":"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/","title":{"rendered":"Ruby on Rails for Windows"},"content":{"rendered":"<p>It was only recently that I FINALLY figured out just what Ruby on Rails is. From most of the posts I saw all I could make of it was &#8220;it&#8217;s the thing that runs Twitter.&#8221; Okay..so what&#8217;s it DO?<\/p>\n<p>Well as it turns out, from what I can make of it, Rails is a new web framework designed to streamline web design&#8230;BETTER than PHP\/ASP\/Javscript. So basically it&#8217;s a new kind of webserver.<\/p>\n<p><!--more--><\/p>\n<p>Well I decided that I wanted to try it out. Unfortunately, I don&#8217;t run on Linux, and every time I do I get very frustrated. So I decided to try and get it going on Windows (XP to be exact). And I did it! Of course, I had to use an online tutorial (which is fairly outdated by about 2 years) located at <a href=\"https:\/\/allaboutruby.wordpress.com\/2006\/01\/09\/installing-rails-on-windows-step-by-step-tutorial\/\" target=\"_blank\" rel=\"noopener\">All About Ruby on WordPress<\/a>.<\/p>\n<p>And with a few modifications and updates to the main system, I was able to get it to work as is right now!<\/p>\n<p>And this is as follows:<\/p>\n<p>Install MySQL (or any other SQL engine, but I already have MySQL installed, so that&#8217;s nice.)<\/p>\n<p>Install Ruby (I had an old version 1.8.7, so I upgraded to 1.9.3p0. The tutorial says you&#8217;d also need to install gems, but I didn&#8217;t have to. 1.9.x came with it pre-loaded. The installer for Windows is located at <a href=\"https:\/\/rubyinstaller.org\/downloads\/\" target=\"_blank\" rel=\"noopener\">RubyInstaller<\/a>. I installed to C:\\Ruby\\ (they recommended C:\\Ruby193\\, but I might want to upgrade. And what&#8217;s next? Ruby194? Ruby200?).<\/p>\n<p>I also made sure I included C:\\Ruby\\ in the windows path, and associated *.rb files. I also installed the TCL\/TK addon, which I doubt I&#8217;ll ever need, but hey, it&#8217;s America where more is better!<\/p>\n<p>One thing I also noticed later on in the installation was that I needed the optional DevKit located on the same page at RubyInstaller. At the time of this writing, the file is called <a href=\"http:\/\/github.com\/downloads\/oneclick\/rubyinstaller\/DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe\" target=\"_blank\" rel=\"noopener\">DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe<\/a>. Otherwise the &#8220;gem&#8221; (a friendly name for ruby add-on methods).<\/p>\n<p>The <a href=\"https:\/\/github.com\/oneclick\/rubyinstaller\/wiki\/development-kit\" target=\"_blank\" rel=\"noopener\">GitHub tutorial<\/a> states that DevKit was written under MinGW. Now I&#8217;m not too happy with Linux frameworks in Windows (MinGW, Cygwin, etc), so I was a little worried that I&#8217;d have to install the actual framework. Not so! If you look at the GitHub tutorial, you&#8217;ll see it has installing boiled down into three nice easy steps.<\/p>\n<p>Unzip (from 7zip format) into a nice friendly Ruby-Dev folder (I chose C:\\ruby-dev\\) and navigate in via cmd window. By the way, I&#8217;ve learned it&#8217;s never good to run ruby scripts from Windows Explorer. If it fails, the resulting command window closes automatically and you never see what&#8217;s going on, so it&#8217;s better to Start\/Run\/cmd.exe and navigate in via the DOS window.<\/p>\n<p>Once in the Ruby-Dev directory, you could run <strong>ruby dk.rb<\/strong>.<\/p>\n<p>This by itself will just display a help screen with what you&#8217;re actually supposed to do.<\/p>\n<h3>ruby dk.rb init<\/h3>\n<p>This generates a config.yml (a configuration file which in this case just tells the installer where the actual Ruby installation is located). You can open this config.yml in a text editor and see what&#8217;s going on. There should be an entry near the bottom that says something like <strong>c:\/ruby<\/strong> or some such. If this line doesn&#8217;t match your Ruby installation, change it so that it does. Remember you only want to go as deep as Ruby&#8217;s top-level directory, not &#8220;bin&#8221; or anything deeper.<\/p>\n<p>Next you run:<\/p>\n<pre class=\"lang:ruby decode:true \">ruby dk.rb review<\/pre>\n<p>and get to see exactly what it&#8217;s going to do based on your config.yml. It&#8217;s not too detailed, so you could just skip this step and go straight to:<\/p>\n<pre class=\"lang:ruby decode:true \">ruby dk.rb install<\/pre>\n<p>It worked for me, even when I did the confirmations listed in the Devkit tutorial on Github, but I won&#8217;t tell you how to do that here. You can just read it for yourself (see the link above).<\/p>\n<p>With this done, I could now begin the Rails installation. Remember rails is simply a new way of web developing. Basically, underneath all of the sparkles, it&#8217;s nothing more than a webserver. Sure a webserver with a completely new way of writing the actual pages, but a webserver nonetheless.<\/p>\n<p>According to Rails On Windows, you can now install the Rails gem. Remember gems are just add-ons for Ruby, much like you can install Android development kits to implement for the Java language. Except gems are just little default programs that can be called from any other program you write yourself to add functionality.<\/p>\n<p>So anyway, install the Rails gem with dependencies included by running from the command window:<\/p>\n<pre class=\"lang:ruby decode:true \">gem install rails --include-dependencies<\/pre>\n<p>If all goes well, the script should download all of the gems required to run rails out of the box, plus all of the documentation (ri and rDoc).<\/p>\n<p>Once this is done, you&#8217;ll be able to create a new directory for your rails project(s) (I put mine in C:\\Rails), navigate there and run:<\/p>\n<pre class=\"lang:ruby decode:true \">rails firstproject<\/pre>\n<p>This will set your project up and hopefully not stall out and crash when it tries to install JSON support (it did when I tried, but that&#8217;s why I set up the DevKit detailed before, and after I did, it worked fine).<\/p>\n<p>Once it&#8217;s completed and you have received the &#8216;finished successfully&#8217; message, you can now navigate into that project folder (<strong>cd firstproject<\/strong>), and run:<\/p>\n<pre class=\"lang:ruby decode:true \">ruby .\/script\/rails server<\/pre>\n<p>Rails will now start up and you should see a few messages such as:<\/p>\n<pre class=\"lang:shell decode:true \">=&gt; Booting WEBrick\r\n=&gt; Rails 3.1.1 application starting in development on http:\/\/0.0.0.0:3000\r\n=&gt;Call with -d to detach\r\n=&gt;Ctrl-C to shut down server\r\n[2011-11-12 13:17:03] INFO  WEBrick 1.3.1\r\n[2011-11-12 13:17:03] INFO  ruby 1.9.3 (2011-10-30) [i386-mingw32]\r\n[2011-11-12 13:17:03] INFO  WEBrick::HTTPServer#start: pid=952 port=3000\r\n<\/pre>\n<p>It may take a while for all of these messages to appear, but once they have, you can now go into your browser and navigate to http:\/\/localhost:3000 and HOPEFULLY see a &#8216;Congratulations and welcome to Ruby on Rails&#8217; or some such title screen.<\/p>\n<p>That&#8217;s the extent of THIS tutorial. I still have yet to figure out how to set up the database and tables and make it all come together that way, but at least I got the server up and running and displaying something nice in my browser!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It was only recently that I FINALLY figured out just what Ruby on Rails is. From most of the posts I saw all I could make of it was &#8220;it&#8217;s the thing that runs Twitter.&#8221; Okay..so what&#8217;s it DO? Well as it turns out, from what I can make of it, Rails is a new [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,121],"tags":[97,396,399,397,398,80,132,400],"class_list":["post-405","post","type-post","status-publish","format-standard","hentry","category-programming","category-web","tag-programming","tag-rails","tag-ror","tag-ruby","tag-ruby-on-rails","tag-tutorial","tag-web","tag-webrick"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ruby on Rails for Windows - PPSStudios<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ruby on Rails for Windows - PPSStudios\" \/>\n<meta property=\"og:description\" content=\"It was only recently that I FINALLY figured out just what Ruby on Rails is. From most of the posts I saw all I could make of it was &#8220;it&#8217;s the thing that runs Twitter.&#8221; Okay..so what&#8217;s it DO? Well as it turns out, from what I can make of it, Rails is a new [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/\" \/>\n<meta property=\"og:site_name\" content=\"PPSStudios\" \/>\n<meta property=\"article:published_time\" content=\"2011-11-12T19:21:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-08-07T17:14:08+00:00\" \/>\n<meta name=\"author\" content=\"Daniel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/\"},\"author\":{\"name\":\"Daniel\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888\"},\"headline\":\"Ruby on Rails for Windows\",\"datePublished\":\"2011-11-12T19:21:09+00:00\",\"dateModified\":\"2018-08-07T17:14:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/\"},\"wordCount\":1021,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888\"},\"keywords\":[\"programming\",\"rails\",\"ror\",\"ruby\",\"ruby on rails\",\"Tutorial\",\"web\",\"webrick\"],\"articleSection\":[\"Programming\",\"Web\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/\",\"url\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/\",\"name\":\"Ruby on Rails for Windows - PPSStudios\",\"isPartOf\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#website\"},\"datePublished\":\"2011-11-12T19:21:09+00:00\",\"dateModified\":\"2018-08-07T17:14:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ppsstudios.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ruby on Rails for Windows\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#website\",\"url\":\"https:\/\/www.ppsstudios.com\/blog\/\",\"name\":\"PPSStudios\",\"description\":\"Formerly \u10d3\u10d0\u10dc\u10d8\u10d4\u10da\u10d8 \u10de\u10d0\u10d5\u10da\u10d8\u10d0\u10e8\u10d5\u10d8\u10da\u10d8\",\"publisher\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ppsstudios.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888\",\"name\":\"Daniel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3a47193e75f82b6ce5dc02478226e41676f8c8cfbb40d962f0ddff8d18e9e3e1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3a47193e75f82b6ce5dc02478226e41676f8c8cfbb40d962f0ddff8d18e9e3e1?s=96&d=mm&r=g\",\"caption\":\"Daniel\"},\"logo\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/www.ppsstudios.com\"],\"url\":\"https:\/\/www.ppsstudios.com\/blog\/author\/danipavliashvili\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ruby on Rails for Windows - PPSStudios","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/","og_locale":"en_US","og_type":"article","og_title":"Ruby on Rails for Windows - PPSStudios","og_description":"It was only recently that I FINALLY figured out just what Ruby on Rails is. From most of the posts I saw all I could make of it was &#8220;it&#8217;s the thing that runs Twitter.&#8221; Okay..so what&#8217;s it DO? Well as it turns out, from what I can make of it, Rails is a new [&hellip;]","og_url":"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/","og_site_name":"PPSStudios","article_published_time":"2011-11-12T19:21:09+00:00","article_modified_time":"2018-08-07T17:14:08+00:00","author":"Daniel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Daniel","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/#article","isPartOf":{"@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/"},"author":{"name":"Daniel","@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888"},"headline":"Ruby on Rails for Windows","datePublished":"2011-11-12T19:21:09+00:00","dateModified":"2018-08-07T17:14:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/"},"wordCount":1021,"commentCount":0,"publisher":{"@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888"},"keywords":["programming","rails","ror","ruby","ruby on rails","Tutorial","web","webrick"],"articleSection":["Programming","Web"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/","url":"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/","name":"Ruby on Rails for Windows - PPSStudios","isPartOf":{"@id":"https:\/\/www.ppsstudios.com\/blog\/#website"},"datePublished":"2011-11-12T19:21:09+00:00","dateModified":"2018-08-07T17:14:08+00:00","breadcrumb":{"@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/11\/ruby-on-rails-for-windows\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ppsstudios.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Ruby on Rails for Windows"}]},{"@type":"WebSite","@id":"https:\/\/www.ppsstudios.com\/blog\/#website","url":"https:\/\/www.ppsstudios.com\/blog\/","name":"PPSStudios","description":"Formerly \u10d3\u10d0\u10dc\u10d8\u10d4\u10da\u10d8 \u10de\u10d0\u10d5\u10da\u10d8\u10d0\u10e8\u10d5\u10d8\u10da\u10d8","publisher":{"@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ppsstudios.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888","name":"Daniel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3a47193e75f82b6ce5dc02478226e41676f8c8cfbb40d962f0ddff8d18e9e3e1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3a47193e75f82b6ce5dc02478226e41676f8c8cfbb40d962f0ddff8d18e9e3e1?s=96&d=mm&r=g","caption":"Daniel"},"logo":{"@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/www.ppsstudios.com"],"url":"https:\/\/www.ppsstudios.com\/blog\/author\/danipavliashvili\/"}]}},"_links":{"self":[{"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/posts\/405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/comments?post=405"}],"version-history":[{"count":2,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/posts\/405\/revisions"}],"predecessor-version":[{"id":570,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/posts\/405\/revisions\/570"}],"wp:attachment":[{"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/media?parent=405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/categories?post=405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/tags?post=405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}