<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>antoniolorusso.com &#187; Rails</title>
	<atom:link href="http://antoniolorusso.com/category/development/ruby/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://antoniolorusso.com</link>
	<description>About me and what I do :)</description>
	<lastBuildDate>Mon, 21 Jun 2010 22:17:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Rails and PostgreSQL</title>
		<link>http://antoniolorusso.com/2010/06/21/rails-and-postgresql/</link>
		<comments>http://antoniolorusso.com/2010/06/21/rails-and-postgresql/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 22:17:54 +0000</pubDate>
		<dc:creator>antonio lorusso</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://antoniolorusso.com/2010/06/21/rails-and-postgresql/</guid>
		<description><![CDATA[Complaining, screaming, sweating, swearing &#8230;. why it doesnt work &#8230; jeeeeeezzz/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection': Please install the postgres adapter: `gem install activerecord-postgres-adapter` (no such file to load -- active_record/connection_adapters/postgres_adapter) (RuntimeError) And then a light &#8230; &#8220;I upgraded postgresql recently!&#8221; Just reinstall the postgres gem and you are done&#8230; What a night!]]></description>
			<content:encoded><![CDATA[<p>Complaining, screaming, sweating, swearing &#8230;. why it doesnt work &#8230; jeeeeeezzz<code>/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection': Please install the postgres adapter: `gem install activerecord-postgres-adapter` (no such file to load -- active_record/connection_adapters/postgres_adapter) (RuntimeError)</code></p>
<p>And then a light &#8230; &#8220;I upgraded postgresql recently!&#8221;</p>
<p>Just reinstall the postgres gem and you are done&#8230;</p>
<p>What a night!</p>
]]></content:encoded>
			<wfw:commentRss>http://antoniolorusso.com/2010/06/21/rails-and-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails and Passenger ( aka mod_rails )</title>
		<link>http://antoniolorusso.com/2009/03/22/rails-and-passenger-aka-mod_rails/</link>
		<comments>http://antoniolorusso.com/2009/03/22/rails-and-passenger-aka-mod_rails/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 13:30:44 +0000</pubDate>
		<dc:creator>antonio lorusso</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[composite primary keys]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[mod_rails]]></category>
		<category><![CDATA[passenger]]></category>

		<guid isPermaLink="false">http://antoniolorusso.com/2009/03/13/rails-and-passenger-aka-mod_rails/</guid>
		<description><![CDATA[We tried to setup a rails application in a server subfolder in a way that could have been accessible through an URL like http://servername/rails,  so we followed the configuration manual for mod_rails.We found that, to make rails works in a subfolder, should have used the Apache parameter RailsBaseURI. With a great surprise, that didn&#8217;t worked [...]]]></description>
			<content:encoded><![CDATA[<p>We tried to setup a rails application in a server subfolder in a way that could have been accessible through an URL like <span style="font-weight: bold;">http://servername/rails</span>,  so we followed the configuration manual for mod_rails.We found that, to make rails works in a subfolder, should have used the Apache parameter <span style="font-weight: bold;">RailsBaseURI</span>.</p>
<p>With a great surprise, that didn&#8217;t worked so we started trying all possible apache configuration combinations to avoid that 404 error that was becoming a nightmare.</p>
<p>After few hours we started doubting about our Apache knowledge and even about our capacity of reading and following a couple of stupid instructions on a website!</p>
<p>We gave up and we started googling around when&#8230; the solution came out from dozens of blogs, forums and newsletters:</p>
<blockquote><p>MOD_RAILS IS NOT COMPATIBLE WITH RAILS 2.2.2 AND ITS NEW ROUTING SYSTEM</p></blockquote>
<p><span style="font-weight: bold;">&#8220;HOLY CRAP</span>&#8221; was our esclamation and I will not mention here all the italian&#8217;s bad words that suddenly came out from our mounth!</p>
<p>So, here the solution: put this line here<br />
<code>config.action_controller.relative_url_root = "/guestbook"</code><br />
in your environment.rb</p>
<p>Now restart apache and enjoy!</p>
<p>ps. why hadn&#8217;t we changed mod_rails with mongrel or anything different? I don&#8217;t know!!!!</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=737895d3-2f2e-43e4-8cec-477c62acba02" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://antoniolorusso.com/2009/03/22/rails-and-passenger-aka-mod_rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rails &#8230; the beginning</title>
		<link>http://antoniolorusso.com/2009/03/13/rails-the-beginning/</link>
		<comments>http://antoniolorusso.com/2009/03/13/rails-the-beginning/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 21:15:05 +0000</pubDate>
		<dc:creator>antonio lorusso</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[migrate]]></category>
		<category><![CDATA[scaffold]]></category>

		<guid isPermaLink="false">http://antoniolorusso.com/?p=173</guid>
		<description><![CDATA[Finally I started a little RoR project with my friend Antonello but we did it in the wrong way We started from the database design (not exactly the rails way) and we are trying to solve problems that a Rails developer usually doesn&#8217;t have like create the scaffold without migration scripts! Here are 3 simple [...]]]></description>
			<content:encoded><![CDATA[<p>Finally I started a little RoR project with my friend Antonello but we did it in the wrong way <img src='http://antoniolorusso.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>We started from the database design (not exactly the rails way) and we are trying to solve problems that a Rails developer usually doesn&#8217;t have like <span style="font-weight: bold;">create the scaffold without migration scripts</span>!</p>
<p>Here are 3 simple steps to do it:<br />	
<ul>
<li>rake db:schema:dump (create the schema dump from the existing database)</li>
<li>mv db/schema.rb db/migrate/001_initial.rb (create the initial migration script manually)</li>
<li>script/generate scaffold firstmodule field1:text field2:varchar field3:date &#8211;skip-migration</li>
</ul>
<p>The most important thing you should never forget is that your tables on the database must have a PLURAL name but use the SINGULAR name when you create the scaffold for that table.<br />&nbsp;( ex: the table name is &#8220;<span style="font-weight: bold;">tools</span>&#8221; but the command to create the scaffold is <span style="font-weight: bold;">script/generate scaffold tool</span> )</p>
<p>Happy RoRing !!!</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=6ccfe230-6968-422e-b5c5-6c6f3bfe43ec" /></div>
]]></content:encoded>
			<wfw:commentRss>http://antoniolorusso.com/2009/03/13/rails-the-beginning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
