<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>has_many :thoughts: Tag tutorial</title>
    <link>http://blog.kineticweb.com/articles/tag/tutorial</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Musings from a Ruby on Rails development team</description>
    <item>
      <title>Request To All Tutorial Writers</title>
      <description>From now on, if your writing this&amp;#8230;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;git clone git://github.com/sam/extlib.git  
git clone git://github.com/sam/do.git

cd extlib
rake install ; cd ..
cd do
cd data_objects
rake install ; cd ..
cd do_mysql  # || do_postgres || do_sqlite3
rake install&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Instead, tell your readers to do this&amp;#8230;&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;git clone git://github.com/sam/extlib.git  
git clone git://github.com/sam/do.git

cd extlib
***rake spec***
rake install ; cd ..
cd do
cd data_objects
***rake spec***
rake install ; cd ..
cd do_mysql  # || do_postgres || do_sqlite3
rake install&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Make sure that your running specs that are passing before installing edge software.&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s another tip, if your trying to learn new software&amp;#8230; or wondering why something isn&amp;#8217;t working for you&amp;#8230; check the specs! They are a great place to learn just exactly how the author approaches using the libraries they write.&lt;/p&gt;</description>
      <pubDate>Wed, 09 Jul 2008 21:09:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:fe6aa9b9-56dd-4902-bc07-5d6a5a15f283</guid>
      <author>Justin Reagor</author>
      <link>http://blog.kineticweb.com/articles/2008/07/09/request-to-all-tutorial-writers</link>
      <category>gems</category>
      <category>rspec</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Soar with Merb-Core and Merb-More (0.9)</title>
      <description>&lt;p&gt;I haven&amp;#8217;t been around in awhile, frankly because I&amp;#8217;ve had my own things to attend to&amp;#8230; but I&amp;#8217;ve felt somewhat ashamed that I&amp;#8217;ve left my kind Kinetic audience a float.  So here is another &amp;#8220;Up and Running&amp;#8221; treat. Cloning Merb-core and -more, from Git[hub] to dummy project.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;&lt;span class="caps"&gt;BTW&lt;/span&gt;, it should be any day now for the official 0.9 release. Rumors have it that Ezra will be releasing it at ActsAsConference.&lt;/em&gt;&lt;/p&gt;


	&lt;h3&gt;Preperation&lt;/h3&gt;


	&lt;p&gt;Your going to want to remove any old gems in the following list, as you will be installing trunk versions in this tutorial.&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;merb (&amp;lt; 0.9)
merb_datamapper (&amp;lt; 0.9)
merb_helpers (&amp;lt; 0.9)
datamapper (&amp;lt; 0.3.0)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;You can go ahead and gem install the following. I&amp;#8217;ve listed the version numbers I use currently.&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;sqlite3-ruby (1.2.1)
data_objects (0.2.0)
do_sqlite3 (0.2.3)
do_mysql(0.2.2)
rack (0.2.0)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Along with the regular Merb dependencies listed in the &lt;span class="caps"&gt;API&lt;/span&gt;.&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;# gem install mongrel json json_pure erubis mime-types rspec hpricot mocha rubigen haml markaby mailfactory Ruby2Ruby -y&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Thats a lotta gems right? Well, taking a closer look you should have most of these already&amp;#8230; and if you don&amp;#8217;t you should.&lt;/p&gt;


	&lt;h3&gt;Installing Git&lt;/h3&gt;


	&lt;p&gt;&lt;a href="http://blog.kineticweb.com/articles/2007/10/30/compiling-git-for-mac-os-x-leopard-10-5"&gt;You installed it already&lt;/a&gt;, otherwise&amp;#8230; &lt;span class="caps"&gt;EPIC FAIL&lt;/span&gt;!&lt;/p&gt;


	&lt;h3&gt;You DO have a Github account&lt;/h3&gt;


	&lt;p&gt;If you have a Github account, you&amp;#8217;ll most likely want to fork merb-core and merb-more so you have your own fork&amp;#8217;s to mess about with. If you find anything interesting you can always submit a bug/patch and help the wonderful Merb team out! Or start building some new framework forked from Merb. Either way&amp;#8230;&lt;/p&gt;


	&lt;p&gt;To do this, login to Github and&amp;#8230;&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;http://github.com/wycats/merb-core/fork
http://github.com/wycats/merb-more/fork
http://github.com/wycats/merb-plugins/fork&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;You&amp;#8217;ll then want to clone these like the next section&amp;#8230;&lt;/p&gt;


	&lt;h3&gt;You &lt;span class="caps"&gt;DON&lt;/span&gt;&amp;#8217;T have a Github account&lt;/h3&gt;


	&lt;p&gt;If you don&amp;#8217;t have an account yet for Github you&amp;#8217;ll still need Git installed like I noted above. From within a fresh directory in Terminal run the following commands.&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;# git clone git://github.com/wycats/merb-core.git
# git clone git://github.com/wycats/merb-more.git
# git clone git://github.com/wycats/merb-plugins.git&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;h3&gt;Installing these Git forks/clones&lt;/h3&gt;


	&lt;p&gt;Simply enter the directories &amp;#8220;&lt;em&gt;merb-core&lt;/em&gt;&amp;#8221; and &amp;#8220;&lt;em&gt;merb-more&lt;/em&gt;&amp;#8221; and run&amp;#8230;&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;# sudo rake install&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;You&amp;#8217;ll also want to do this under &amp;#8220;&lt;em&gt;merb-plugins/merb_datamapper&lt;/em&gt;&amp;#8221; and &amp;#8220;&lt;em&gt;merb-plugins/merb_helpers&lt;/em&gt;&amp;#8221;. Including any others in &amp;#8220;&lt;em&gt;merb-plugins&lt;/em&gt;&amp;#8221; you would like installed.&lt;/p&gt;


	&lt;h3&gt;Installing Datamapper Trunk&lt;/h3&gt;


	&lt;p&gt;Currently, Datamapper is still under &lt;span class="caps"&gt;SVN&lt;/span&gt;. I&amp;#8217;m positive this will change in the near future. But for now&amp;#8230;&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;# svn co http://datamapper.rubyforge.org/svn/trunk/ data_mapper&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Then simply go into the data_mapper/ directory created and do&amp;#8230;&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;# sudo rake install&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;h3&gt;Merb-gen is your Friend?&lt;/h3&gt;


	&lt;p&gt;I&amp;#8217;ve just recently discovered that they&amp;#8217;ve changed, yet again, the default way of creating a new Merb project. I guess because &amp;#8220;&lt;em&gt;merb -g&lt;/em&gt;&amp;#8221; or &amp;#8220;&lt;em&gt;merb&lt;/em&gt;&amp;#8221; was getting annoying, so &amp;#8220;&lt;em&gt;merb-gen [projectname]&lt;/em&gt;&amp;#8221; is some how much simpler. You also use this to generate models/controllers/resources/etc&amp;#8230; :/&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m going to take another guess and say this is somehow based on the project directory no longer needing to conform to a certain structure like Rails. I&amp;#8217;ve heard this, but I haven&amp;#8217;t tested it out for fact&amp;#8230; so let me know your experiences.&lt;/p&gt;


	&lt;p&gt;Either way&amp;#8230;&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;# merb-gen lovely-app&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;h3&gt;Going into Toshi Station to pick up some power converters&lt;/h3&gt;


	&lt;p&gt;This is where it starts to get exciting. The fruit of our labors dance in unison to form a euphoric aura called &amp;#8220;0.9&amp;#8221;... not so fast though.&lt;/p&gt;


	&lt;p&gt;1. If your not already, make sure your in the &amp;#8220;&lt;em&gt;lovely-app/&lt;/em&gt;&amp;#8221; project directory.&lt;/p&gt;


	&lt;p&gt;2. Open up &amp;#8220;&lt;em&gt;config/init.rb&lt;/em&gt;&amp;#8221; and uncomment&amp;#8230;&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;use_orm :datamapper&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Rspec should be your testing framework by default.&lt;/p&gt;


	&lt;p&gt;3. Back in your shell, run&amp;#8230;&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;# rake --tasks&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;4. This should auto-generate &amp;#8220;&lt;em&gt;config/database.sample.yml&lt;/em&gt;&amp;#8220;&lt;/p&gt;


	&lt;p&gt;5. Overwrite the entire thing with the following, and save as &amp;#8220;&lt;em&gt;config/database.yml&lt;/em&gt;&amp;#8221;...&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;---
:development: &amp;amp;build
  :adapter: sqlite3
  :database: db/dev.db

:test:
  &amp;lt;&amp;lt;: *build
  :database: db/test.db

:production:
  :adapter: mysql
  :database: lovely_app
  :username: root
  :password: &amp;quot;&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;6. Your going to now want to create those sqlite databases. If not both just db/dev.db.&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;# mkdir db/
# sqlite3 db/dev.db
SQLite version 3.5.1
Enter &amp;quot;.help&amp;quot; for instructions
sqlite&amp;gt; .databases
seq  name             file                                                      
---  ---------------  ----------------------------------------------------------
0    main             /Users/bionicebonics/lovely-app/db/dev.db                     
sqlite&amp;gt; .quit&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;You should be able to run a successful &amp;#8220;&lt;em&gt;rake&amp;#8212;tasks&lt;/em&gt;&amp;#8221; if you did everything correctly. You may also want to test and see if you can run the daemon, and pull up a browser window. Run &amp;#8220;&lt;em&gt;merb&lt;/em&gt;&amp;#8221; by itself from Merb.root or project root directory.&lt;/p&gt;


	&lt;p&gt;In short, just start hacking! Reference the &lt;span class="caps"&gt;API&lt;/span&gt; for help, not me.&lt;/p&gt;


	&lt;h3&gt;The Sugar&lt;/h3&gt;


	&lt;p&gt;You should now have a base process for exploring Merb 0.9 development.&lt;/p&gt;


	&lt;h3&gt;The Salt&lt;/h3&gt;


	&lt;p&gt;If for some weird reason your getting errors running &amp;#8220;merb&amp;#8221;, make sure you removed any old versions of Merb &amp;lt;= 0.5.x.&lt;/p&gt;


	&lt;p&gt;Also try uninstalling merb-core and reinstalling it from a new Git clone of the main repo. I had to do this for some odd reason whilst running through this tutorial.&lt;/p&gt;


	&lt;h3&gt;Shameless Kinetic/PhillyOnRails&lt;/h3&gt;


	&lt;p&gt;Colin will be giving a talk on Merb at our local &lt;a href="http://www.phillyonrails.org/"&gt;PhillyOnRails Users Group&lt;/a&gt;, so stay tuned for info on that.&lt;/p&gt;


	&lt;h2&gt;Update&lt;/h2&gt;


	&lt;p&gt;Gotta love Merb integrating &lt;a href="http://rack.rubyforge.org/"&gt;Rack/WSGI&lt;/a&gt;!&lt;/p&gt;


	&lt;p&gt;Following a few discussions on the &lt;a href="http://code.macournoyer.com/thin/"&gt;Thin webserver&lt;/a&gt; mailing list, I just tried Merb on Thin&amp;#8230; this is working out excellent! I&amp;#8217;ve also heard that Ezra just got 2200 req/sec using Thin.&lt;/p&gt;


	&lt;p&gt;If you would like to explore the possibilities of this incredibly fast setup, simply do&amp;#8230;&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_shell "&gt;# sudo gem install thin
# cd lovely-app
# merb -a thin&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;This will load Merb on Thin. If you don&amp;#8217;t know about Thin, I&amp;#8217;m not going to sit here and explain it. I&amp;#8217;m just not like that. You&amp;#8217;ll have to &lt;span class="caps"&gt;FOFY&lt;/span&gt;, &lt;a href="http://code.macournoyer.com/thin/doc/files/README.html"&gt;find-out-for-yourself&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Sat, 09 Feb 2008 01:31:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:96a186fc-4aef-4504-9955-8be244d9b63e</guid>
      <author>Justin Reagor</author>
      <link>http://blog.kineticweb.com/articles/2008/02/09/soar-with-merb-core-and-merb-more-0-9</link>
      <category>merb</category>
      <category>git</category>
      <category>tutorial</category>
      <category>thin</category>
      <category>rack</category>
    </item>
  </channel>
</rss>
