<?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; Ruby</title>
	<atom:link href="http://antoniolorusso.com/category/development/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://antoniolorusso.com</link>
	<description>About me and what I do :)</description>
	<lastBuildDate>Mon, 25 Jul 2011 10:52:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Nokogiri, RVM, Homebrew and headhache!!!</title>
		<link>http://antoniolorusso.com/2011/06/11/nokogiri-rvm-homebrew-and-headhache/</link>
		<comments>http://antoniolorusso.com/2011/06/11/nokogiri-rvm-homebrew-and-headhache/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 13:32:48 +0000</pubDate>
		<dc:creator>antonio lorusso</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://antoniolorusso.com/?p=391</guid>
		<description><![CDATA[Thanks to a gist (which I forked and slightly changed) I was able to finally install Nokogiri on my mac: If you had MacPorts previously installed, it might still not work so sudo mv /opt/local /opt/local_old and try again. Enjoy &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p>Thanks to a gist (which I forked and slightly changed) I was able to finally install Nokogiri on my mac:</p>
<div id="gist-1020543" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="nb">export </span><span class="nv">BREW_HOME</span><span class="o">=</span>/usr/local</div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'>brew install libxml2</div><div class='line' id='LC4'>brew link libxml2</div><div class='line' id='LC5'>brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/libxslt.rb</div><div class='line' id='LC6'>brew link libxslt</div><div class='line' id='LC7'>brew install libiconv</div><div class='line' id='LC8'>brew link libiconv</div><div class='line' id='LC9'>gem install nokogiri -- --with-xml2-dir<span class="o">=</span><span class="nv">$BREW_HOME</span>/Cellar/libxml2/2.7.8 --with-xslt-dir<span class="o">=</span><span class="nv">$BREW_HOME</span>/Cellar/libxslt/1.1.26 --with-iconv-dir<span class="o">=</span><span class="nv">$BREW_HOME</span>/Cellar/libiconv/1.13.1/</div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1020543/b4097ee332ff6d70fe232add8814a6e5f67e67c5/gistfile1.bash" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1020543#file_gistfile1.bash" style="float:right;margin-right:10px;color:#666">gistfile1.bash</a>
            <a href="https://gist.github.com/1020543">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>If you had MacPorts previously installed, it might still not work so<br />
<code>sudo mv /opt/local /opt/local_old</code><br />
and try again.</p>
<p>Enjoy <img src='http://antoniolorusso.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://antoniolorusso.com/2011/06/11/nokogiri-rvm-homebrew-and-headhache/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<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>Macports, Snow Leopard and XCode 3.2</title>
		<link>http://antoniolorusso.com/2009/10/18/macports-snow-leopard-and-xcode-3-2/</link>
		<comments>http://antoniolorusso.com/2009/10/18/macports-snow-leopard-and-xcode-3-2/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 00:09:47 +0000</pubDate>
		<dc:creator>antonio lorusso</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://antoniolorusso.com/?p=255</guid>
		<description><![CDATA[When I upgraded my macbook to Snow Leopard, macports just worked as it was before, or so I thought, until yesterday when I tried to install ImageMagick and rmagick ruby gem and I got this error: gem install rmagick ERROR: Error installing rmagick: ERROR: Failed to build gem native extension. /opt/local/bin/ruby extconf.rb checking for Ruby [...]]]></description>
			<content:encoded><![CDATA[<p>When I upgraded my macbook to Snow Leopard, macports just worked as it was before, or so I thought, until yesterday when I tried to install ImageMagick and rmagick ruby gem and I got this error:<br />
<code>gem install rmagick<br />
ERROR:  Error installing rmagick:<br />
ERROR: Failed to build gem native extension.<br />
/opt/local/bin/ruby extconf.rb<br />
checking for Ruby version &gt;= 1.8.5... yes<br />
checking for gcc... yes<br />
checking for Magick-config... yes<br />
checking for ImageMagick version &gt;= 6.3.5... yes<br />
checking for HDRI disabled version of ImageMagick... yes<br />
checking for stdint.h... no<br />
checking for sys/types.h... no<br />
checking for wand/MagickWand.h... no<br />
Can't install RMagick 2.11.1. Can't find MagickWand.h.<br />
*** extconf.rb failed ***<br />
Could not create Makefile due to some reason, probably lack of<br />
necessary libraries and/or headers.  Check the mkmf.log file for more<br />
details.  You may need configuration options.<br />
Provided configuration options:<br />
--with-opt-dir<br />
--without-opt-dir<br />
--with-opt-include<br />
--without-opt-include=${opt-dir}/include<br />
--with-opt-lib<br />
--without-opt-lib=${opt-dir}/lib<br />
--with-make-prog<br />
--without-make-prog<br />
--srcdir=.<br />
--curdir<br />
--ruby=/opt/local/bin/ruby<br />
</code><br />
After having lost the best of my youth trying to fix this issue, I can&#8217;t remember exactly how I did it, but I came up with this idea of reinstalling ruby and&#8230; guess what? It did work!<br />
So the lesson here is &#8230; whenever you upgrade to a major release of XCode, you have to reinstall all your macports. These commands can save your day or two:<br />
<code>$ sudo port selfupdate<br />
$ sudo port sync<br />
$ sudo port upgrade --force installed<br />
</code><br />
 <img src='http://antoniolorusso.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://antoniolorusso.com/2009/10/18/macports-snow-leopard-and-xcode-3-2/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>
		<item>
		<title>RubyOnRails excitement</title>
		<link>http://antoniolorusso.com/2008/06/28/rubyonrails-excitement-2/</link>
		<comments>http://antoniolorusso.com/2008/06/28/rubyonrails-excitement-2/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 23:43:00 +0000</pubDate>
		<dc:creator>antonio lorusso</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://antoniolorusso.com/2008/06/28/rubyonrails-excitement-2/</guid>
		<description><![CDATA[I just want to share how excited I am studying Ruby and RubyOnRails. Soon I&#8217;ll start the development of a Facebook application with Rails. stay tuned!]]></description>
			<content:encoded><![CDATA[<p>I just want to share how excited I am studying Ruby and RubyOnRails.<br />
Soon I&#8217;ll start the development of a Facebook application with Rails.</p>
<p>stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://antoniolorusso.com/2008/06/28/rubyonrails-excitement-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
