{"id":378,"date":"2007-11-06T14:18:46","date_gmt":"2007-11-06T18:18:46","guid":{"rendered":"http:\/\/www.dr-chuck.com\/wordpress\/?p=378"},"modified":"2011-12-18T13:36:53","modified_gmt":"2011-12-18T17:36:53","slug":"using-rails-in-leopard","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2007\/11\/using-rails-in-leopard\/","title":{"rendered":"Using Rails in Leopard"},"content":{"rendered":"<p>Here are some notes from SI539 &#8211; when you upgrade to Leopard &#8211; pretty much you no longer need Locomotive as it has plenty of Ruby and Rails built-in.<br \/>\n$ rails &#8211;version<br \/>\nRails 1.2.3<br \/>\n$ ruby &#8211;version<br \/>\nruby 1.8.6 (2007-06-07 patchlevel 36) [universal-darwin9.0]<br \/>\nHere are some notes as to how to use it instead of Locomotive &#8211; actually now DOS and Mac are even more similar.<\/p>\n<p><!--more--><br \/>\nThere is good news and bad news about the upgrade to Leopard &#8211; ignore this if you run Mac OS 10.4 or Windows.<br \/>\n&#8211; The bad news is the Locomotive breaks<br \/>\n&#8211; The good news is that Locomotive was a pain in the backside and that Leopard has a very recent version and Ruby *and* Rails out of the box!!!!!<br \/>\nSo you never have to use Locomotive again &#8211; yayayay &#8211; and I never have to make a Macintosh install for this class ever again &#8211; because it is already installed on macs!!!! YAYAYAYAYA<br \/>\nSo here is your really translation from Locomotive to command line.  Form now on the stuff you do on a Mac will be like what we do in Windows.  I assume that you keep the rails_apps directory in Documents.  Open a terminal window under Applications -> Utilities -> Terminal<br \/>\nGo into the rails_apps driectory<br \/>\ncd ~\/Documents\/rails_apps<br \/>\nls<br \/>\nThe ls command should list the contents of the directory &#8211; it should have directories like assn7, midterm, each &#8211; one for each rails directory.<br \/>\nTo start the rails Server (like pressing the green button in Locomotive)<br \/>\ncd assn7  (whichever directory)<br \/>\nruby script\/server<br \/>\nPoint your browser to http:\/\/localhost:3000\/ &#8211; viola!  The terminal window also shows you the log &#8211; so there is no need for an extra &#8220;tail window&#8221; &#8211; double prizes!<br \/>\nTo stop the server press CTRL-C in the server window &#8211; this terminates the server and gets you back to the command prompt.<br \/>\nTo make a new application called &#8220;assn9&#8221; do the following:<br \/>\ncd ~\/Documents\/rails_apps<br \/>\nrails assn9 -d sqlite3<br \/>\nIt will set up the database as SQLlite3 automatically &#8211; no more cutting and pasting the database.yml files!  Yay!<br \/>\nThen to add a controller &#8211; it is the same as ever<br \/>\ncd assn9<br \/>\nruby script\/generate controller portal index<br \/>\nruby script\/generate model Story<br \/>\nAnd to start it up jsut do<br \/>\nruby script\/server<br \/>\nPressing control-C when done or when you want to restart your server &#8211; like if you changed a vendor module.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here are some notes from SI539 &#8211; when you upgrade to Leopard &#8211; pretty much you no longer need Locomotive as it has plenty of Ruby and Rails built-in. $ rails &#8211;version Rails 1.2.3 $ ruby &#8211;version ruby 1.8.6 (2007-06-07 patchlevel 36) [universal-darwin9.0] Here are some notes as to how to use it instead of [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-378","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=378"}],"version-history":[{"count":2,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/378\/revisions"}],"predecessor-version":[{"id":2893,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/378\/revisions\/2893"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}