<?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>Include::RAWblog &#187; Ruby</title>
	<atom:link href="http://www.sufixo.com/raw/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sufixo.com/raw</link>
	<description>hacking my life</description>
	<lastBuildDate>Fri, 19 Mar 2010 15:23:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sinatra Take #2</title>
		<link>http://www.sufixo.com/raw/2009/09/18/sinatra-take-2/</link>
		<comments>http://www.sufixo.com/raw/2009/09/18/sinatra-take-2/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 14:50:23 +0000</pubDate>
		<dc:creator>include</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.sufixo.com/raw/?p=461</guid>
		<description><![CDATA[Because this will not be a ordered list of Sinatra posts&#8230;
I will mention right now some advantages of Sinatra
Use your toolbox!

You can choose your favorite template engine.

ERB, Haml, Builder, &#8230;


Do you have a favorite ORM?

ActiveRecord, DataMapper, Sequel, &#8230;


Javascript?

jQuery, Prototipe, Dojo, &#8230;


tests

Test::Unit, RSpec, Bacon, &#8230;


more to come&#8230;
]]></description>
			<content:encoded><![CDATA[<p>Because this will not be a ordered list of <a href="http://www.sinatrarb.com">Sinatra</a> posts&#8230;</p>
<p>I will mention right now some advantages of Sinatra</p>
<p><strong>Use your toolbox!</strong></p>
<ul>
<li>You can choose your favorite template engine.</li>
<ul>
<li>ERB, Haml, Builder, &#8230;</li>
</ul>
<p></p>
<li>Do you have a favorite ORM?</li>
<ul>
<li>ActiveRecord, DataMapper, Sequel, &#8230;</li>
</ul>
<p></p>
<li>Javascript?</li>
<ul>
<li>jQuery, Prototipe, Dojo, &#8230;</li>
</ul>
<p></p>
<li>tests</li>
<ul>
<li>Test::Unit, RSpec, Bacon, &#8230;</li>
</ul>
</ul>
<p><i>more to come&#8230;</i></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sufixo.com/raw/2009/09/18/sinatra-take-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding with Sinatra</title>
		<link>http://www.sufixo.com/raw/2009/09/16/coding-with-sinatra/</link>
		<comments>http://www.sufixo.com/raw/2009/09/16/coding-with-sinatra/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 17:05:17 +0000</pubDate>
		<dc:creator>include</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.sufixo.com/raw/?p=437</guid>
		<description><![CDATA[As a SysAdmin I do love my work but sometimes we need to code also!
Some months ago I found this awesome microframework.
Sinatra





&#8220;&#8230; Sinatra is a DSL for quickly creating web applications in Ruby with minimal effort:&#8230;&#8221;


Well thats it. I need move some tasks from command line to the web and Sinatra is what I have [...]]]></description>
			<content:encoded><![CDATA[<p>As a SysAdmin I do love my work but sometimes we need to code also!</p>
<p>Some months ago I found this awesome microframework.<br />
<a href="http://www.sinatrarb.com/"><strong>Sinatra</strong></a><br />
<br />
<center><br />
<img src="http://www.sinatrarb.com/images/logo.gif"><br />
<br />
<i><br />
&#8220;&#8230; Sinatra is a DSL for quickly creating web applications in Ruby with minimal effort:&#8230;&#8221;<br />
</i><br />
</center></p>
<p>Well thats it. I need move some tasks from command line to the web and Sinatra is what I have found to be the most cool.</p>
<pre><code>
# sudo gem install sinatra
# vi mywebapp.rb

require 'rubygems'
require 'sinatra'

get '/' do
  erb :index
end

__END__

@@layout
&lt;html>
  &lt;head>&lt;/head&gt;
  &lt;body>
    &lt;%= yield %&gt;
  &lt;/body&gt;
&lt;/html&gt;

@@index
Helloa!

# ruby mywebapp.rb ; lynx http://localhost:4567
</code></pre>
<p>Easy right? Next post I will introduce some more stuff about Sinatra and maybe CRUD operations coded from the root.</p>
<p>take care.</p>
<p>PS: I do need to think about this CSS!! It&#8217;s a PITA!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sufixo.com/raw/2009/09/16/coding-with-sinatra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redmine 0.8 on Dreamhost</title>
		<link>http://www.sufixo.com/raw/2009/01/30/redmine-08-on-dreamhost/</link>
		<comments>http://www.sufixo.com/raw/2009/01/30/redmine-08-on-dreamhost/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 16:20:13 +0000</pubDate>
		<dc:creator>include</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://www.sufixo.com/raw/?p=311</guid>
		<description><![CDATA[For those who are trying to get Redmine to work on Dreamhost using Passenger, check out these notes.I had lots of problems mostly because 1) of reading too much outdated information, 2) reading wrong information too, so&#8230; the simple way is:
Start from a clean base install&#8230;
 1. Cleaning up the house:
 1.1 Remove all stuff [...]]]></description>
			<content:encoded><![CDATA[<p>For those who are trying to get <a href="http://www.redmine.org/">Redmine</a> to work on <a href="http://www.dreamhost.com/">Dreamhost</a> using <a href="http://www.modrails.com/">Passenger</a>, check out these notes.I had lots of problems mostly because 1) of reading too much outdated information, 2) reading wrong information too, so&#8230; the simple way is:</p>
<p>Start from a clean base install&#8230;</p>
<pre> 1. Cleaning up the house:
 1.1 Remove all stuff related with gems on you home directory
  $ cd ~ ; rm -rf .gem*
 1.2 Remove all GEM_PATH's in your .bash_profile (there are many howtos with inconsistent information about this)
  (after removing, reload it)
  $ source .bash_profile
 2. Install Rails 2.1.2 because Redmine 0.8 needs it
  $ gem install rails -v=2.1.2
 3. Check its installetion
  $ gem list --local | grep 'rails'
  rails (2.2.2, <strong>2.1.2</strong>, 2.1.1, 2.1.0, 2.0.2)</pre>
<p>Ok, now lets continue&#8230;</p>
<p>(quoting original post: <a href="http://wiki.dreamhost.com/Redmine">Dreamhost howto</a>)</p>
<pre>  1. From the Dreamhost control panel, create a new subdomain for the application such as yoursubdomain.yourdomain.com
        1. Make sure the domain supports “Ruby on Rails Passenger (mod_rails)?”
        2. Specify your web directory: /home/username/yoursubdomain.yourdomain.com/public
               * you must add the public!!!
  2. From the Dreamhost control panel create a new MySQL database named yourdatabasename
  3. ssh into your Dreamhost account
  4. cd ~/yoursubdomain.yourdomain.com
  5. svn export --force svn://rubyforge.org/var/svn/redmine/branches/<strong>0.8-stable</strong> ./
         * check <a class="external free" title="http://www.redmine.org/wiki/redmine/Download" rel="nofollow" href="http://www.redmine.org/wiki/redmine/Download">http://www.redmine.org/wiki/redmine/Download</a> for the latest version
  6. also watch out for permissions
         * chmod -v -R 755 ./*
  7. cd ~/yoursubdomain.yourdomain.com/config
  8. cp database.yml.example database.yml
  9. nano database.yml
        1. edit the database.yml config file with the appropriate info. Should be similar to the following
           production:
           adapter: mysql
           database: yourdatabasename
           username: yourusername
           password: yourpassword
           host: mysql.yourdomain.com
 10. cd ~/yoursubdomain.yourdomain.com/public
 11. cp dispatch.rb.example dispatch.rb
<span style="text-decoration: line-through;"> 12. nano .htaccess (replace with following text)
     Options +FollowSymLinks +ExecCGI
     RewriteEngine On
     RewriteRule ^$ index.html [QSA]
     RewriteRule ^([^.]+)$ $1.html [QSA]
     RewriteCond %{REQUEST_FILENAME} !-f
     ErrorDocument 500 "H2Application errorH2 Rails application failed to start properly"
         * replace the H2 with the proper HTML tag when you place it in the .htaccess</span>
 12. for now just remove .htaccess to get it working, then you can play with it at the end.
   $ mv public/.htaccess public/.htaccess_off
 13. cd ~/yoursubdomain.yourdomain.com
 13.1 Some chamges in environment.rb
   $ vi config/environment.rb
 13.2 Uncomment this line
   ENV['RAILS_ENV'] ||= 'production'
 13.3 and take attention to this one, we do want this version!
   RAILS_GEM_VERSION = '<strong>2.1.2</strong>' unless defined? RAILS_GEM_VERSION
 13.4 now lets point it to use our gem_path on our local gem directory
   ENV["GEM_PATH"]="/home/<strong>&lt;YOUR USERNAME&gt;</strong>/<strong>.gem</strong>:/usr/lib/ruby/gems/1.8"
  (Attention to .gem agains .gems directory from other tutorials.
    with a fresh clean install, rubygem install everything on .gem by default, so lets KISS)
 13.5 PStore error? Change this:
   #  config.action_controller.session_store = <img src='http://www.sufixo.com/raw/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> Store
      config.action_controller.session = {
            :session_key =&gt; "_myapp_session",
            :secret =&gt; "some secret phrase of at least 30 characters"
     }
 13.6 and finally freeze the app
   $ rake rails:freeze:edge TAG=rel_2-1-2
 14. from application root type
         * rake db:migrate RAILS_ENV="production"
 15. also type the following to load config defaults
         * rake redmine:load_default_data RAILS_ENV="production"
         * choose "en" for english
 16. Before pointint your browser to <a class="external free" title="http://yoursubdomain.yourdomain.com" rel="nofollow" href="http://yoursubdomain.yourdomain.com/">http://yoursubdomain.yourdomain.com</a>
   you must RESTART your application. Some tutorials are wrong telling your to REBOOT the app.
   $ echo `date`&gt;&gt; tmp/<strong>restart.txt</strong> ; cat tmp/restart.txt
 16. browse to <a class="external free" title="http://yoursubdomain.yourdomain.com" rel="nofollow" href="http://yoursubdomain.yourdomain.com/">http://yoursubdomain.yourdomain.com</a></pre>
<p>I hope this can help you! Drop me a post if you have some suggestions&#8230; I need them too <img src='http://www.sufixo.com/raw/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sufixo.com/raw/2009/01/30/redmine-08-on-dreamhost/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
