<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Learning Rails</title>
	<link>http://joelandkaren.com/learningrails</link>
	<description>Joel Greenberg's Experience in Learning Web Development with Ruby on Rails</description>
	<pubDate>Mon, 16 Jun 2008 23:23:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.3</generator>
	<language>en</language>
			<item>
		<title>Finally, Up and Running! Part 1</title>
		<link>http://joelandkaren.com/learningrails/archives/25</link>
		<comments>http://joelandkaren.com/learningrails/archives/25#comments</comments>
		<pubDate>Mon, 05 Feb 2007 03:46:29 +0000</pubDate>
		<dc:creator>joelg</dc:creator>
		
		<category><![CDATA[Ruby Language]]></category>

		<guid isPermaLink="false">http://joelandkaren.com/learningrails/archives/25</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://joelandkaren.com/learningrails/archives/25/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The values returned by &#124;&#124; and &#038;&#038;</title>
		<link>http://joelandkaren.com/learningrails/archives/17</link>
		<comments>http://joelandkaren.com/learningrails/archives/17#comments</comments>
		<pubDate>Sat, 03 Feb 2007 07:45:35 +0000</pubDate>
		<dc:creator>joelg</dc:creator>
		
		<category><![CDATA[Ruby Language]]></category>

		<guid isPermaLink="false">http://joelandkaren.com/learningrails/archives/17</guid>
		<description><![CDATA[Ruby has logic that appears to me&#8230;well&#8230;logical.  I feel there&#8217;s a &#8220;groove&#8221; to thinking in Ruby.  I&#8217;m not able to articulate it further, probably because I&#8217;m not that familiar yet with the language.  But there&#8217;s something about the way things work in Ruby that makes sense to me.  It&#8217;s taken me [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby has logic that appears to me&#8230;well&#8230;logical.  I feel there&#8217;s a &#8220;groove&#8221; to thinking in Ruby.  I&#8217;m not able to articulate it further, probably because I&#8217;m not that familiar yet with the language.  But there&#8217;s something about the way things work in Ruby that makes sense to me.  It&#8217;s taken me a lot of reading and playing in irb, but by experimenting, I&#8217;m starting to understand Ruby&#8217;s groove.</p>
<p>One example is the caparison operators for <em>and </em>(&#038;&#038;) and <em>or </em>(||).  At first glance, there&#8217;s nothing really different about them.  But, let the narrative in <a href="http://www.amazon.com/exec/obidos/redirect?link_code=ur2&#038;tag=friendstalkin-20&#038;camp=1789&#038;creative=9325&#038;path=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2F0974514055%2Fsr%3D8-1%2Fqid%3D1149471616%2Fref%3Dpd_bbs_1%3F%255Fencoding%3DUTF8">The Pick Axe Book</a><img width="1" height="1" border="0" style="border: medium none  ! important; margin: 0px ! important" src="http://www.assoc-amazon.com/e/ir?t=friendstalkin-20&#038;l=ur2&#038;o=1" /> sink in and I have an &#8220;a-ha&#8221; experience.  &#8220;That&#8217;s why they do it that way!&#8221;.</p>
<p>Turns out, Ruby does only as much as it needs to do in order to return true and false.  Take &#038;&#038; , for example.  &#038;&#038; is true if both expressions are true.  It&#8217;s false if one expression is false.  So, if you end up with a statement</p>
<blockquote><p>false &#038;&#038; true</p></blockquote>
<p>Ruby  returns false, obviously.   With ||, if the first expression is false, Ruby goes on to the second, which determines the value of the expression.  In other words,</p>
<blockquote><p>false || true</p></blockquote>
<p>returns true. And,</p>
<blockquote><p>true || false</p></blockquote>
<p>returns true.  Pretty straightforward stuff; it explains the common     idiom:</p>
<p>variable = expression || default value</p>
<p>But Ruby also has the value nil.  Here&#8217;s where things get interesting.  With &#038;&#038;, nil behaves much like false,</p>
<blockquote><p>true &#038;&#038; nil</p></blockquote>
<p>returns nil. But with &#038;&#038;, Ruby only goes so far as the first expression if it finds it&#8217;s not true (in other words, nil or false). Eg:</p>
<blockquote><p>nil &#038;&#038; false</p></blockquote>
<p>returns nil, NOT false.  Conversely,</p>
<blockquote><p>false &#038;&#038; nil</p></blockquote>
<p>returns false, NOT nil.</p>
<p>not true</p>
<p>returns false.</p>
<p>not false</p>
<p>returns true</p>
<p>not nil</p>
<p>returns true</p>
<p>Interesting, no?  Most of the time, nil and false behave the same.  The only exception is under the following three statements, which all return nil:</p>
<p style="margin-left: 40px">nil &#038;&#038; true<br />
true &#038;&#038; nil<br />
nil &#038;&#038; false</p>
<p style="margin-left: 40px">
<p>Wacky, but true.</p>
]]></content:encoded>
			<wfw:commentRss>http://joelandkaren.com/learningrails/archives/17/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby on Rails Cheat Sheet</title>
		<link>http://joelandkaren.com/learningrails/archives/23</link>
		<comments>http://joelandkaren.com/learningrails/archives/23#comments</comments>
		<pubDate>Wed, 31 Jan 2007 04:29:26 +0000</pubDate>
		<dc:creator>joelg</dc:creator>
		
		<category><![CDATA[Ruby Language]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Language Tips]]></category>

		<guid isPermaLink="false">http://joelandkaren.com/learningrails/archives/23</guid>
		<description><![CDATA[A shout out to Adrian, who left a message on one of my posts encouraging me to keep going with rails.  He pointed me to a nice Ruby on Rails Cheat Sheet written by a technologist named Pascal. It succinctly lists out commands you&#8217;d need to create a Rails application.  I wish one of [...]]]></description>
			<content:encoded><![CDATA[<p>A shout out to <a href="http://www.arctus.co.uk/">Adrian</a>, who left a message on one of my posts encouraging me to keep going with rails.  He pointed me to a nice <a href="http://blog.nanorails.com/pages/rails_1.1_cheat_sheet">Ruby on Rails Cheat Sheet</a> written by a technologist named Pascal. It succinctly lists out commands you&#8217;d need to create a Rails application.  I wish one of the books I bought had this list; it&#8217;s really handy.</p>
]]></content:encoded>
			<wfw:commentRss>http://joelandkaren.com/learningrails/archives/23/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Agile Web Dev with Rails vs Ruby for Rails</title>
		<link>http://joelandkaren.com/learningrails/archives/22</link>
		<comments>http://joelandkaren.com/learningrails/archives/22#comments</comments>
		<pubDate>Tue, 30 Jan 2007 06:08:07 +0000</pubDate>
		<dc:creator>joelg</dc:creator>
		
		<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://joelandkaren.com/learningrails/archives/22</guid>
		<description><![CDATA[I gave a talk tonight to Bootstrap Austin&#8217;s web SIG on Second Life.  I brought the ad agency where I work into Second Life and am advising clients on the best way to use it.  It was a small, but interested group of folks&#8230;less than ten.  With one exception, we were all [...]]]></description>
			<content:encoded><![CDATA[<p>I gave a talk tonight to <a href="http://www.bootstrapaustin.org/">Bootstrap Austin&#8217;s</a> web SIG on <a href="http://joelandkaren.com/learningrails/www.secondlife.com">Second Life</a>.  I brought the <a href="http://www.gsdm.com">ad agency</a> where I work <a href="http://slurl.com/secondlife/Idea%20City/114/125/36/?x=335&#038;y=300&#038;img=http%3A//blog.ideacity.com/wp-content/uploads/2006/12/ideacity1.jpg&#038;title=Idea%20City&#038;msg=Idea%20City%2C%20home%20of%20GSD%26M%20in%20Second%20Life.%20%20Provides%20sustainable%20results%20for%20brands%20that%20have%20a%20genuine%20purpose.">into </a>Second Life and am advising clients on the best way to use it.  It was a small, but interested group of folks&#8230;less than ten.  With one exception, we were all programmers or former programmers.</p>
<p>After we exhausted talking about Second Life, the talk turned to Ruby.  I was astounded by the fact that everyone was either working in Ruby, learning Ruby, or, with the exception of the one non-programmer, involved in discussing whether or not to use Ruby.  All were talking about using Rails for web development.</p>
<p>A consensus emerged.  Professional programmers,  those who program for a living, love <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FAgile-Development-Rails-Dave-Thomas%2Fdp%2F0977616630%2Fsr%3D8-1%2Fqid%3D1169789944%3Fie%3DUTF8%26s%3Dbooks&#038;tag=friendstalkin-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Agile Development with Rails.</a> Those that are learning, but who haven&#8217;t programmed professionally for a few years (almost a decade for me), get more out of <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FRuby-Rails-Techniques-Developers%2Fdp%2F1932394699%2Fsr%3D1-1%2Fqid%3D1169790014%3Fie%3DUTF8%26s%3Dbooks&#038;tag=friendstalkin-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Ruby for Rails.</a><img width="1" height="1" border="0" style="border: medium none  ! important; margin: 0px ! important" src="http://www.assoc-amazon.com/e/ir?t=friendstalkin-20&#038;l=ur2&#038;o=1" /> An small, but interesting, observation.</p>
]]></content:encoded>
			<wfw:commentRss>http://joelandkaren.com/learningrails/archives/22/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby for Rails by David A. Black</title>
		<link>http://joelandkaren.com/learningrails/archives/21</link>
		<comments>http://joelandkaren.com/learningrails/archives/21#comments</comments>
		<pubDate>Fri, 26 Jan 2007 05:58:00 +0000</pubDate>
		<dc:creator>joelg</dc:creator>
		
		<category><![CDATA[Ruby Language]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://joelandkaren.com/learningrails/archives/21</guid>
		<description><![CDATA[After a number of months hiatus, I&#8217;m back to learning Ruby, again because I have ideas I want to sketch out in code.  If I&#8217;m going to be learning a new language anyway, then Ruby seems to give me the most bang for the buck and seems to be easy to wrap my head [...]]]></description>
			<content:encoded><![CDATA[<p>After a number of months hiatus, I&#8217;m back to learning Ruby, again because I have ideas I want to sketch out in code.  If I&#8217;m going to be learning a new language anyway, then Ruby seems to give me the most bang for the buck and seems to be easy to wrap my head around.  My experience with object oriented coding has been with Lingo, Director&#8217;s language (back in the multimedia days), Java, and a Forth-like language called Magic/L back in the pre-cambrian period of programming.  What&#8217;s really nice about Ruby is once I understood things like iterators, I saw how compact and English-like the language really could be.  Odd, seeing as the language was invented by a Japaneese speaker whose second language is English.</p>
<p>I was talking about my frustrations about learning Ruby and Rails to my friend, <a href="http://opposablemind.typepad.com/">David Sedlow</a>, using the <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FAgile-Development-Rails-Dave-Thomas%2Fdp%2F0977616630%2Fsr%3D8-1%2Fqid%3D1169789944%3Fie%3DUTF8%26s%3Dbooks&#038;tag=friendstalkin-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Agile Development with Rails </a><img width="1" height="1" border="0" style="border: medium none  ! important; margin: 0px ! important" src="http://www.assoc-amazon.com/e/ir?t=friendstalkin-20&#038;l=ur2&#038;o=1" /> book.  We both come from a we-used-to-be-programmers but-haven&#8217;t-done-it-professionally-in-years background. (To me, the book needs to be user tested because it makes some assumptions that you already know Rails&#8230;inadvertently, or not.)  David suggested <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FRuby-Rails-Techniques-Developers%2Fdp%2F1932394699%2Fsr%3D1-1%2Fqid%3D1169790014%3Fie%3DUTF8%26s%3Dbooks&#038;tag=friendstalkin-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Ruby for Rails</a><img width="1" height="1" border="0" style="border: medium none  ! important; margin: 0px ! important" src="http://www.assoc-amazon.com/e/ir?t=friendstalkin-20&#038;l=ur2&#038;o=1" /> by David A. Black.  I have found <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FRuby-Rails-Techniques-Developers%2Fdp%2F1932394699%2Fsr%3D1-1%2Fqid%3D1169790014%3Fie%3DUTF8%26s%3Dbooks&#038;tag=friendstalkin-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Ruby for Rails</a><img width="1" height="1" border="0" style="border: medium none  ! important; margin: 0px ! important" src="http://www.assoc-amazon.com/e/ir?t=friendstalkin-20&#038;l=ur2&#038;o=1" /> easy to understand.  It explains things in a logical sequence and explains them thoroughly.  It&#8217;s also a nice mix between Ruby and Rails, making the reasonable assumption that you need to understand Ruby if you want to understand Rails.<img align="left" src="http://ec1.images-amazon.com/images/P/1932394699.01._AA240_SCLZZZZZZZ_V37019386_.jpg" />This book is enough to get started with Rails development.  I believe between this and the <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FProgramming-Ruby-Pragmatic-Programmers-Second%2Fdp%2F0974514055%2Fsr%3D1-1%2Fqid%3D1169790287%3Fie%3DUTF8%26s%3Dbooks&#038;tag=friendstalkin-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">The Pickaxe Book</a><img width="1" height="1" border="0" style="border: medium none  ! important; margin: 0px ! important" src="http://www.assoc-amazon.com/e/ir?t=friendstalkin-20&#038;l=ur2&#038;o=1" />, I have what I need to get going with Ruby and Rails.  I may not even need to the Pick Axe book, it&#8217;s that good at providing a basic understanding of Ruby.</p>
<p>Indeed, last night I hacked out a little screen scraper that prints out the items viewed from a youtube.com page.  Not much, but with many ad agencies and brands putting their commercials on YouTube, I believe it could be a simple, useful tool.  Give it a list of YouTube url&#8217;s to track and it returns a  simple list of desired videos with the number of times they&#8217;ve been viewed.  This tracking guide would be useful to folks in the marketing world.</p>
]]></content:encoded>
			<wfw:commentRss>http://joelandkaren.com/learningrails/archives/21/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rails and Relationional Databases - Why is this so Hard?</title>
		<link>http://joelandkaren.com/learningrails/archives/12</link>
		<comments>http://joelandkaren.com/learningrails/archives/12#comments</comments>
		<pubDate>Sat, 06 May 2006 23:00:17 +0000</pubDate>
		<dc:creator>joelg</dc:creator>
		
		<category><![CDATA[Rails Issues]]></category>

		<guid isPermaLink="false">http://joelandkaren.com/learningrails/archives/12</guid>
		<description><![CDATA[I&#8217;ve found that Rails is really easy to create CRUD.  Create/retrieve/update/delete databases is really easy.  You set up the database, run a ruby command at the command line, and you get the basic web forms you need to create, list, update, and delete records in a database.  Then, you dress up the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found that Rails is really easy to create CRUD.  Create/retrieve/update/delete databases is really easy.  You set up the database, run a ruby command at the command line, and you get the basic web forms you need to create, list, update, and delete records in a database.  Then, you dress up the html with CSS and you&#8217;re on your way.</p>
<p>Rails is a great way to easily create database applications on the web.</p>
<p>Until you need a relational database.</p>
<p>Figuring it out relational databases are hard, primarily because you have to: 1) name the relationships correctly, and 2) tell ruby about the relationships.  I haven&#8217;t figured all this out yet and I have felt really frustrated seeing as single tables are easy.</p>
<p>I thought it was me, but then I found <a href="http://discuss.joelonsoftware.com/default.asp?joel.3.309321.3">Rails Ridiculous Restrictions, Rant</a>, which outlines the problem with Rails nicely.  Basically, the ranter&#8217;s argument is that Rails should be smart enough to figure out the relationships without having the programmer tell it what those relationships are.  And I agree.</p>
]]></content:encoded>
			<wfw:commentRss>http://joelandkaren.com/learningrails/archives/12/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Initial Tips</title>
		<link>http://joelandkaren.com/learningrails/archives/6</link>
		<comments>http://joelandkaren.com/learningrails/archives/6#comments</comments>
		<pubDate>Wed, 03 May 2006 14:25:23 +0000</pubDate>
		<dc:creator>joelg</dc:creator>
		
		<category><![CDATA[Ruby Language]]></category>

		<guid isPermaLink="false">http://joelandkaren.com/learningrails/archives/6</guid>
		<description><![CDATA[Here are some initial Ruby operators and conventions that tripped me up, hopefully with coherent explanations so they won&#8217;t trip you up as well.

&#8220;!&#8221;  in method names
It&#8217;s a convention that Ruby method names that end in &#8220;!&#8221; actually change the data.  Eg:
var1 =[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
var1.sort
>> [0, [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some initial Ruby operators and conventions that tripped me up, hopefully with coherent explanations so they won&#8217;t trip you up as well.</p>
<h3 />
<h3>&#8220;!&#8221;  in method names</h3>
<p>It&#8217;s a convention that Ruby method names that end in &#8220;!&#8221; actually change the data.  Eg:</p>
<blockquote><p>var1 =[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]</p>
<p>var1.sort</p>
<p>>> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]</p></blockquote>
<p>You may think the above changes the values held bay the variable &#8220;var1&#8243;.  But if you print out &#8220;var1&#8243; again, you get the array in the original order:</p>
<blockquote><p>var1</p>
<p>>> [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]</p></blockquote>
<p>The &#8220;sort&#8221; method returns the sort, but doesn&#8217;t change the actual order of the items in the array.  But, The &#8220;sort<strong>!</strong>&#8221; method does: Eg:</p>
<blockquote><p>var1.sort!<br />
>> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]</p>
<p>var1</p>
<p>>>  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]</p></blockquote>
<p>If your method actually changes the data, have it end in an exclamation point.</p>
<h3>&#8220;?&#8221;  in method names</h3>
<p>It&#8217;s a Ruby convention that methods that end in a question mark are tests that return &#8220;true&#8221; or &#8220;false&#8221;.  Eg:</p>
<blockquote><p>var1 =[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]</p>
<p>var1.include?(5)</p>
<p>>> true</p>
<p>var1.include?(10)</p>
<p>>> false</p></blockquote>
<p>If your method is intended as a test and returns &#8220;true&#8221; or &#8220;false&#8221;, name your method with  a question mark.</p>
<h3>&#8220;=&#8221;  in method names</h3>
<p>It&#8217;s a Ruby convention that method names that end in &#8220;=&#8221; are assignment methods.  For example:</p>
<blockquote><p>my.address= &#8220;1808 Ruby Way&#8221; or</p>
<p>my.address= (&#8221;1808 Ruby Way&#8221;)</p></blockquote>
<p>assigns &#8220;1808 Ruby Way&#8221; to a variable (class, or instance).</p>
<blockquote />
<h3>%w{} is a Quick Way to Assign a List</h3>
<p>You can create a list quickly out of a text string with %w{}.  For example,</p>
<blockquote><p>ary=%w{This is a test}</p></blockquote>
<p>returns</p>
<blockquote><p>[&#8221;this&#8221;, &#8220;is&#8221;, &#8220;a&#8221;, &#8220;test&#8221;]</p></blockquote>
<h3>class#method means class.method</h3>
<p>In the documentation, you&#8217;ll find things things like</p>
<blockquote><p>class#method (note the hash mark)</p></blockquote>
<p>referring to something in code that&#8217;s actually writen</p>
<blockquote><p>class.method  (note the dot)</p></blockquote>
<p>I don&#8217;t know the reasons why, but it&#8217;s confusing at first.   But at least now you know.</p>
<blockquote />
]]></content:encoded>
			<wfw:commentRss>http://joelandkaren.com/learningrails/archives/6/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nice Little Tutorial</title>
		<link>http://joelandkaren.com/learningrails/archives/10</link>
		<comments>http://joelandkaren.com/learningrails/archives/10#comments</comments>
		<pubDate>Fri, 28 Apr 2006 03:31:56 +0000</pubDate>
		<dc:creator>joelg</dc:creator>
		
		<category><![CDATA[Ruby Language]]></category>

		<guid isPermaLink="false">http://joelandkaren.com/learningrails/archives/10</guid>
		<description><![CDATA[http://tryruby.hobix.com/
is a nice little, interactive tutorial. It is an IRB session in a web page, with a tutorial you type along with. Nice intro to Ruby.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://tryruby.hobix.com/">http://tryruby.hobix.com/</a></p>
<p>is a nice little, interactive tutorial. It is an IRB session in a web page, with a tutorial you type along with. Nice intro to Ruby.</p>
]]></content:encoded>
			<wfw:commentRss>http://joelandkaren.com/learningrails/archives/10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Writing my first rails app with a database</title>
		<link>http://joelandkaren.com/learningrails/archives/9</link>
		<comments>http://joelandkaren.com/learningrails/archives/9#comments</comments>
		<pubDate>Sat, 22 Apr 2006 19:13:49 +0000</pubDate>
		<dc:creator>joelg</dc:creator>
		
		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Gnarly Bugs]]></category>

		<guid isPermaLink="false">http://joelandkaren.com/learningrails/archives/9</guid>
		<description><![CDATA[So, yesterday I figured out that I could connect to the MySQL database using a different port: 3306.  Today, I tried using MySQLFront.  Bummer, but I still couldn&#8217;t connect to a database.  I looked for a free MySQL client and found SQL Manager 2005 Lite.  That finally worked.  So, I [...]]]></description>
			<content:encoded><![CDATA[<p>So, yesterday I figured out that I could connect to the MySQL database using a different port: 3306.  Today, I tried using <a href="http://www.mysqlfront.de/">MySQLFront.</a>  Bummer, but I still couldn&#8217;t connect to a database.  I looked for a free MySQL client and found <a href="http://www.sqlmanager.net/products/mssql/manager">SQL Manager 2005 Lite.</a>  That finally worked.  So, I created my first database-driven Rails app, following along in  <em>Agile Web Development With Rails</em>.</p>
<p>Finally, on my way to learning Rails!</p>
]]></content:encoded>
			<wfw:commentRss>http://joelandkaren.com/learningrails/archives/9/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Can&#8217;t Make MySQL Table for Rails</title>
		<link>http://joelandkaren.com/learningrails/archives/8</link>
		<comments>http://joelandkaren.com/learningrails/archives/8#comments</comments>
		<pubDate>Fri, 21 Apr 2006 14:00:37 +0000</pubDate>
		<dc:creator>joelg</dc:creator>
		
		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Gnarly Bugs]]></category>

		<guid isPermaLink="false">http://joelandkaren.com/learningrails/archives/8</guid>
		<description><![CDATA[I ran into my first &#8220;bug&#8221; the stopped me cold. I define a &#8220;bug&#8221; as anything that prevents me from moving forward, whether it&#8217;s code, configuration, poor interface, etc. It&#8217;s a practical definition based upon the fact that I&#8217;m programming to solve a problem, to get something done, and if I can&#8217;t, then I need [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into my first &#8220;bug&#8221; the stopped me cold. I define a &#8220;bug&#8221; as anything that prevents me from moving forward, whether it&#8217;s code, configuration, poor interface, etc. It&#8217;s a practical definition based upon the fact that I&#8217;m programming to solve a problem, to get something done, and if I can&#8217;t, then I need to fix it so I can.</p>
<p>The problem was permissions on the MySQL database when following along on pg. 55 of <a href="http://www.amazon.com/exec/obidos/redirect?link_code=ur2&amp;#038;tag=friendstalkin-20&amp;#038;camp=1789&amp;#038;creative=9325&amp;#038;path=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2F097669400X%2Fsr%3D8-1%2Fqid%3D1145457858%2Fref%3Dpd_bbs_1%3F%255Fencoding%3DUTF8">Agile Web Development with Rails : A Pragmatic Guide</a><img width="1" height="1" border="0" style="border: medium none  ! important; margin: 0px ! important" src="http://www.assoc-amazon.com/e/ir?t=friendstalkin-20&amp;amp;l=ur2&amp;amp;o=1" />.  It&#8217;s the first exercise of hooking up a database to Rails.</p>
<p>As part of building the MySQL table, the exercise has you execute the following line:</p>
<blockquote>
<pre>depot> mysql depot_development</pre>
</blockquote>
<p>Up to this point in the exercise, connecting to the database was done with the username &#8220;root&#8221; and no password. Everything worked fine. But executing the above line caused the following error.</p>
<blockquote>
<pre>ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)</pre>
</blockquote>
<p>Can&#8217;t finish creating the database.  Rats!</p>
<h4>The Solution</h4>
<p>Long story short, the solution was found in the MySQL Error Log.  In it, I kept on seeing citations that had &#8220;port:3306&#8243; in it.</p>
<p>Instead of trying to connect and build the database from the command line, like it&#8217;s illustrated in the book, I decided to use <a href="http://www.mysqlfront.de/">MySQL-Front</a> to connect to the database.   But I still could not.<br />
Now, the server that ships with Rails, WEBrick, apparently is on port 3000.  I tried that port in MySQL-Front.  No luck.</p>
<p>So, I tried using port 3306.  It connected just fine!</p>
<p>Now, I haven&#8217;t actually tried to manipulate the table in MySQL-front, or Rails, just yet because I&#8217;ve run out of timing trying to solve this problem, but I think I solved the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://joelandkaren.com/learningrails/archives/8/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
