<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>DNA of the TUX &#187; ruby</title>
	<atom:link href="http://tuxdna.wordpress.com/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://tuxdna.wordpress.com</link>
	<description>Organized thoughts</description>
	<lastBuildDate>Tue, 14 May 2013 18:00:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='tuxdna.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>DNA of the TUX &#187; ruby</title>
		<link>http://tuxdna.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tuxdna.wordpress.com/osd.xml" title="DNA of the TUX" />
	<atom:link rel='hub' href='http://tuxdna.wordpress.com/?pushpress=hub'/>
		<item>
		<title>A bug in RPM ? ( for rubygem-sprockets and rubygem-tilt )</title>
		<link>http://tuxdna.wordpress.com/2012/03/05/a-bug-in-rpm-for-rubygem-sprockets-and-rubygem-tilt/</link>
		<comments>http://tuxdna.wordpress.com/2012/03/05/a-bug-in-rpm-for-rubygem-sprockets-and-rubygem-tilt/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 12:48:23 +0000</pubDate>
		<dc:creator>tuxdna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://tuxdna.wordpress.com/?p=441</guid>
		<description><![CDATA[I packaged Rails 3.1.0 and its dependencies few days back for Fedora 16. The repository configuration file is as below: Now when I installed Rails 3.1.0, I got into a in issue: On the surface it seems that rubygem-sprockets wants rubygem-tilt with a version less than 1.3.0 ( we have only 1.3.3 and 1.3.2 available [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tuxdna.wordpress.com&#038;blog=10303502&#038;post=441&#038;subd=tuxdna&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I packaged<a href="http://tuxdna.fedorapeople.org/packaging/rubygems/f16/" target="_blank"> Rails 3.1.0 and its dependencies</a> few days back for Fedora 16. The repository configuration file is as below:</p>
<pre class="brush: plain; title: ; notranslate">
[rails3]
name=rails3
baseurl=http://tuxdna.fedorapeople.org/packaging/rubygems/f16/
enabled=1
gpgcheck=0
</pre>
<p>Now when I installed Rails 3.1.0, I got into a in issue:</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo yum install rubygem-rails-3.1.0
...OUTPUT SKIPPED...
--&gt; Running transaction check
---&gt; Package rubygem-polyglot.noarch 0:0.3.3-1.fc16 will be installed
---&gt; Package rubygem-sprockets.noarch 0:2.0.3-1.fc16 will be installed
--&gt; Processing Dependency: rubygem(tilt) &lt; 1.3.0 for package: rubygem-sprockets-2.0.3-1.fc16.noarch
--&gt; Finished Dependency Resolution
Error: Package: rubygem-sprockets-2.0.3-1.fc16.noarch (psb)
           Requires: rubygem(tilt) &lt; 1.3.0
           Installed: rubygem-tilt-1.3.3-1.fc16.noarch (@psb)
               rubygem(tilt) = 1.3.3
           Available: rubygem-tilt-1.3.2-1.fc16.noarch (fedora)
               rubygem(tilt) = 1.3.2
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
</pre>
<p>On the surface it seems that rubygem-sprockets wants rubygem-tilt with a version <strong>less than 1.3.0</strong> ( we have only 1.3.3 and 1.3.2 available here). However rubygem-sprockets also accepts rubygem-tilt with a version <strong>greater than 1.3.0</strong>, which is evident from the dependency list:</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo yum deplist rubygem-sprockets-2.0.3-1.fc16.noarch 
Loaded plugins: auto-update-debuginfo, langpacks, presto, refresh-packagekit
Finding dependencies: 
package: rubygem-sprockets.noarch 2.0.3-1.fc16
...OUTPUT SKIPPED...
  dependency: rubygem(tilt) &gt;= 1.1
   provider: rubygem-tilt.noarch 1.3.3-1.fc16
  dependency: rubygem(tilt) &gt; 1.3.0
   provider: rubygem-tilt.noarch 1.3.3-1.fc16
  dependency: rubygem(tilt) &lt; 1.3.0
   Unsatisfied dependency
  dependency: rubygem(tilt) &lt; 2
   provider: rubygem-tilt.noarch 1.3.3-1.fc16
</pre>
<p>To verify that it is actually a problem specific to RPM, I downloaded the RPMs and tried installing with rpm command rather than yum:</p>
<pre class="brush: bash; title: ; notranslate">
$ yumdownloader rubygem-tilt-1.3.3-1.fc16.noarch
$ yumdownloader rubygem-sprockets-2.0.3-1.fc16.noarch
$ ls
rubygem-sprockets-2.0.3-1.fc16.noarch.rpm  rubygem-tilt-1.3.3-1.fc16.noarch.rpm
$ sudo rpm -i rubygem-sprockets-2.0.3-1.fc16.noarch.rpm 
error: Failed dependencies:
	rubygem(hike) &gt;= 1.2 is needed by rubygem-sprockets-2.0.3-1.fc16.noarch
	rubygem(hike) &lt; 2 is needed by rubygem-sprockets-2.0.3-1.fc16.noarch
	rubygem(tilt) &lt; 1.3.0 is needed by rubygem-sprockets-2.0.3-1.fc16.noarch
</pre>
<p>Cleary RPM doesn&#8217;t handle package version intervals well even though the information is available inside the package &#8211; rubygem-sprockets requires </p>
<pre class="brush: plain; title: ; notranslate">
rubygem-tilt: &gt;= 1.1, &lt; 1.3.0, &gt; 1.3.0, &lt; 2.0.0
</pre>
<p>I have RPM version 4.9.1.2 running on Linux 3.2.7-1.fc16.x86_64.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tuxdna.wordpress.com/441/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tuxdna.wordpress.com/441/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tuxdna.wordpress.com&#038;blog=10303502&#038;post=441&#038;subd=tuxdna&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tuxdna.wordpress.com/2012/03/05/a-bug-in-rpm-for-rubygem-sprockets-and-rubygem-tilt/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4a485e339c4de35684dfe31dc758041e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tuxdna</media:title>
		</media:content>
	</item>
		<item>
		<title>Problems with Ruby GEM to RPM</title>
		<link>http://tuxdna.wordpress.com/2012/03/04/problems-with-ruby-gem-to-rpm/</link>
		<comments>http://tuxdna.wordpress.com/2012/03/04/problems-with-ruby-gem-to-rpm/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 12:12:50 +0000</pubDate>
		<dc:creator>tuxdna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubygem]]></category>

		<guid isPermaLink="false">http://tuxdna.wordpress.com/?p=415</guid>
		<description><![CDATA[I can&#8217;t emphasize more the importance of packaging RPMs ( or any other packaging system ), as I already did it in an earlier post. Same arguments apply to Ruby Gems as well. That is to say, Ruby Gems already have a gem command to install and update packages. However it is still not a [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tuxdna.wordpress.com&#038;blog=10303502&#038;post=415&#038;subd=tuxdna&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I can&#8217;t emphasize more the importance of packaging RPMs ( or any other packaging system ), as I already did it in an earlier <a href="http://tuxdna.wordpress.com/2012/01/27/packaging-java-jars-as-rpm-packages/" title="Packaging Java JARs as RPM packages " target="_blank">post</a>.</p>
<p>Same arguments apply to Ruby Gems as well. That is to say, Ruby Gems already have a <code>gem</code> command to install and update packages. However it is still not a complete packaging system in itself.</p>
<p>Consider the situation where you need to install a gem called A which dependes on B and C. So you will do:</p>
<p><code>gem install A</code></p>
<p><strong>Problem 1: Handling of install failure</strong></p>
<p>This would obviously install the gems in this order B, C and A. It does works for mostly perfect situations. However if C fails to install, &#8220;gem&#8221; won&#8217;t rollback ( i.e. uninstall B ) any steps till C&#8217;s failure. This is a problem.</p>
<p><strong>Problem 2: Creating RPM packages with ease</strong></p>
<p>If you ever happen to use <a href="http://docs.python.org/release/2.0/dist/creating-rpms.html" target="_blank">Python&#8217;s distutils</a>, you will find that it has ability to generate RPM packages from the setup.py itself. Which means an even wider adoption of Python packages.</p>
<p><code>python setup.py bdist_rpm</code></p>
<p>What takes for &#8220;gem&#8221; to support such a functionality? Since creating, installing, packaging and distributing Ruby gems is such a common activity for Ruby developers, I believe such should be available within the standard Ruby distribution.</p>
<p>For now I am using <a href="https://github.com/lutter/gem2rpm" target="_blank">gem2rpm</a> gem which requires a lot of manual intervention. Here is how it works ( as in my earlier <a href="http://tuxdna.wordpress.com/2012/02/22/ruby-gem-to-rpm-all-in-one-go/" title="Ruby GEM to RPM all in one go" target="_blank">post</a> ):</p>
<p><code><br />
gem fetch rubygem-my-favorite<br />
gem2rpm -s rubygem-my-favorite.gem<br />
</code></p>
<p>Checkout its <a href="https://github.com/lutter/gem2rpm" target="_blank">documentation</a> for more details.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tuxdna.wordpress.com/415/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tuxdna.wordpress.com/415/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tuxdna.wordpress.com&#038;blog=10303502&#038;post=415&#038;subd=tuxdna&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tuxdna.wordpress.com/2012/03/04/problems-with-ruby-gem-to-rpm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4a485e339c4de35684dfe31dc758041e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tuxdna</media:title>
		</media:content>
	</item>
		<item>
		<title>JRuby on Rails with RVM ( on Fedora )</title>
		<link>http://tuxdna.wordpress.com/2012/01/29/jruby-on-rails-with-rvm-fedora/</link>
		<comments>http://tuxdna.wordpress.com/2012/01/29/jruby-on-rails-with-rvm-fedora/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 12:10:12 +0000</pubDate>
		<dc:creator>tuxdna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rvm]]></category>

		<guid isPermaLink="false">http://tuxdna.wordpress.com/?p=411</guid>
		<description><![CDATA[First install RVM and set it up: To include RVM into your bash shell, add following line to ~/.bashrc: Now install JRuby and use it as default Ruby interpreter: Setup Rails environment: Lets create a new Rails application: Now go to http://localhost:3000/people/ Yay! Your new Rails application is up and running, powered by JRuby ( [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tuxdna.wordpress.com&#038;blog=10303502&#038;post=411&#038;subd=tuxdna&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>First install <a href="https://rvm.beginrescueend.com/" target="_blank">RVM</a> and set it up:</p>
<pre class="brush: bash; title: ; notranslate">
sudo yum install rubygem-rvm
rvm-install
</pre>
<p>To include RVM into your bash shell, add following line to <code>~/.bashrc</code>:</p>
<pre class="brush: bash; title: ; notranslate">
[[ -s &quot;$HOME/.rvm/scripts/rvm&quot; ]] &amp;&amp; . &quot;$HOME/.rvm/scripts/rvm&quot; # This loads RVM into a shell session.
</pre>
<p>Now install <a href="http://jruby.org/" target="_blank">JRuby</a> and use it as default Ruby interpreter:</p>
<pre class="brush: bash; title: ; notranslate">
source ~/.bashrc
rvm install jruby-1.5.6
rvm use jruby-1.5.6
</pre>
<p>Setup <a href="http://rubyonrails.org/" target="_blank">Rails</a> environment:</p>
<pre class="brush: bash; title: ; notranslate">
gem install rails
gem install bundler
</pre>
<p>Lets create a new Rails application:</p>
<pre class="brush: bash; title: ; notranslate">
rails new rails-app
cd rails-app
bundle install
rails g scaffold Person name:string
rake db:migrate
rails s
</pre>
<p>Now go to <a href="http://localhost:3000/people/" rel="nofollow">http://localhost:3000/people/</a><br />
Yay! Your new Rails application is up and running, powered by JRuby ( setup using RVM ).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tuxdna.wordpress.com/411/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tuxdna.wordpress.com/411/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tuxdna.wordpress.com&#038;blog=10303502&#038;post=411&#038;subd=tuxdna&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tuxdna.wordpress.com/2012/01/29/jruby-on-rails-with-rvm-fedora/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4a485e339c4de35684dfe31dc758041e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tuxdna</media:title>
		</media:content>
	</item>
	</channel>
</rss>
