<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Straight Ornamental: Category Rails</title>
    <link>http://grahamstratton.org/blog/public/articles/category/rails</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Ramblings from a rambler</description>
    <item>
      <title>More fcgi</title>
      <description>&lt;p&gt;After discovering that the error message in my last post was apparently due to a gcc bug (in debian stable?!?), I decided to have another go.  For some reason gem install fcgi worked without installing anything else new.  Then I just had to change the apache config file slightly and fiddle with permissions of lots of log files, and fix a bug in typo, and now I have fcgi working again.&lt;/p&gt;</description>
      <pubDate>Tue, 08 Aug 2006 00:33:23 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:3634a4ea-080e-46c0-8def-6514173249e9</guid>
      <author>Graham Stratton</author>
      <link>http://grahamstratton.org/blog/public/articles/2006/08/08/more-fcgi</link>
      <category>Rails</category>
      <category>Debian</category>
    </item>
    <item>
      <title>No more fcgi</title>
      <description>&lt;p&gt;After the complexity of trying to get mod_fcgid to install last time, I&amp;#8217;m giving up and just using cgi this time.&lt;/p&gt;


	&lt;p&gt;I tried what I did last time, but&lt;/p&gt;


	&lt;p&gt;gem install fcgi&lt;/p&gt;


	&lt;p&gt;failed with&lt;/p&gt;


	&lt;p&gt;checking for &lt;span class="caps"&gt;FCGX&lt;/span&gt;_Accept() in -lfcgi&amp;#8230; no&lt;/p&gt;


	&lt;p&gt;I found someone who claimed to have a setup working, by compiling fcgi from fastcgi.com for themselves, but when I tried the compiler spewed this one:&lt;/p&gt;


	&lt;p&gt;multiple definition of `__i686.get_pc_thunk.bx&amp;#8217;&lt;/p&gt;


	&lt;p&gt;I really don&amp;#8217;t know why it&amp;#8217;s so hard.  Surely apache2 on debian must be one of the more common deployment platforms?&lt;/p&gt;</description>
      <pubDate>Wed, 02 Aug 2006 20:02:17 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:7076f94b-82f3-49fa-804a-2046fd1d0de4</guid>
      <author>Graham Stratton</author>
      <link>http://grahamstratton.org/blog/public/articles/2006/08/02/no-more-fcgi</link>
      <category>Rails</category>
      <category>Debian</category>
    </item>
    <item>
      <title>Server upgrade</title>
      <description>&lt;p&gt;I&amp;#8217;ve now completed moving most of my stuff to my new server.  So far, this blog has caused me most grief.  I spent ages trying to get typo to install. I kept getting the error&lt;/p&gt;


	&lt;p&gt;checking for sqlite3_open() in -lsqlite3&lt;/p&gt;


	&lt;p&gt;when trying to install the typo gem.  It turned out that not only is one required to have libsqlite3 and libsqlite3-dev installed, but one mustn&amp;#8217;t have libsqlite or libsqlite-dev installed.  Apparently installing the debian package build-essential is also required.&lt;/p&gt;</description>
      <pubDate>Wed, 02 Aug 2006 18:07:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:c2718aee-65f6-4843-a49f-85c698cf0fc3</guid>
      <author>Graham Stratton</author>
      <link>http://grahamstratton.org/blog/public/articles/2006/08/02/server-upgrade</link>
      <category>Rails</category>
      <category>Typo</category>
    </item>
    <item>
      <title>fcgi fun</title>
      <description>&lt;p&gt;I&amp;#8217;ve been trying to set up Rails with fcgi using mod_fcgid and apache2 on my debian-based system.&lt;/p&gt;


	&lt;p&gt;I had a load of errors that looked like this in my Apache error log&lt;/p&gt;


&lt;pre&gt;
[error] (13)Permission denied: mod_fcgid: couldn't bind unix domain socket /etc/apache2/logs/fcgidsock/1534.5
[warn] (13)Permission denied: mod_fcgid: spawn process /home/graham/public_html/blog/dispatch.fcgi error
&lt;/pre&gt;

	&lt;p&gt;I solved this with&lt;/p&gt;


&lt;pre&gt;sudo chmod 555 /etc/apache2/logs/&lt;/pre&gt;

	&lt;p&gt;The apache log then said&lt;/p&gt;


&lt;pre&gt;
[notice] mod_fcgid: server /home/graham/public_html/blog/dispatch.fcgi(1814) started
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__': no such file to load -- fcgi (MissingSourceFile)
&lt;/pre&gt;

So, I need to install ruby-fcgi.  There is no debian package, but just do 
&lt;pre&gt;sudo gem install fcgi&lt;/pre&gt; assuming ruby gems is installed.

	&lt;p&gt;Comments about &lt;pre&gt;`require': no such file to load -- mkmf (LoadError)&lt;/pre&gt; mean that you didn&amp;#8217;t install ruby-dev.&lt;/p&gt;


Death during &lt;pre&gt;checking for fcgiapp.h... no&lt;/pre&gt; means libfcgi isn&amp;#8217;t installed:
&lt;pre&gt;
sudo apt-get install libfcgi
sudo apt-get install libfcgi-dev
sudo apt-get install libfcgi-ruby
&lt;/pre&gt;

&lt;pre&gt;/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__': no such file to load -- rdoc/rdoc (LoadError)&lt;/pre&gt; means that I never got round to installing rdoc:

&lt;pre&gt;sudo apt-get install rdoc&lt;/pre&gt;

	&lt;p&gt;Now everything installs!  However, there&amp;#8217;s still an error at runtime about not being able to write to fcgi.crash.log  So I set the log in dispatch.fcgi to something writeable, but it doesn&amp;#8217;t put anything useful there. Apache just returns a server error and there are segfaults in the apache log.&lt;/p&gt;


	&lt;p&gt;The remaining problem was presumably that the application couldn&amp;#8217;t connect to the database (not sure that should result in a segfault), since starting it in production mode worked!!&lt;/p&gt;</description>
      <pubDate>Mon, 23 Jan 2006 10:56:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:275d4f823e5103c0261398f1445fe4ed</guid>
      <author>Graham Stratton</author>
      <link>http://grahamstratton.org/blog/public/articles/2006/01/23/fcgi-fun</link>
      <category>Rails</category>
    </item>
    <item>
      <title>mod_fcgid fun</title>
      <description>&lt;p&gt;Since lighttpd seems to be the recommended way of running Rails applications, but I can&amp;#8217;t find any evidence of anyone using it to host Zope3 applications, I need another solution.  mod_fastcgi is apparently buggy, so mod_fcgid is currently recommended. To install it, follow the instructions at http://paul.querna.org/journal/articles/2006/01/01/using-mod_fcgid-for-ruby-on-rails-applications
You&amp;#8217;ll need apache2-dev, if it&amp;#8217;s not already installed.&lt;/p&gt;</description>
      <pubDate>Sun, 22 Jan 2006 12:52:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:e6ff7c81636dedfa7fad804a1cdd07e6</guid>
      <author>Graham Stratton</author>
      <link>http://grahamstratton.org/blog/public/articles/2006/01/22/mod_fcgid-fun</link>
      <category>Rails</category>
    </item>
    <item>
      <title>One thing leads to another...</title>
      <description>&lt;p&gt;I need a more interesting name for my blog.  Last night I thought &amp;#8216;import this&amp;#8217; would be good.  Oh well.  Not only has it been done, it&amp;#8217;s been done by someone whose primary interests are python and ruby web frameworks.&lt;/p&gt;


	&lt;p&gt;However, from that blog I did come across a small conference in the states called &lt;a href="http://www.snakesandrubies.com/event/"&gt;Snakes and Rubies&lt;/a&gt;, and the website has some interesting information from it.&lt;/p&gt;


	&lt;p&gt;I haven&amp;#8217;t heard on any dedicated UK python conference, uk ruby conference, or uk rails conference.  I wonder how many people would be interested if such an event happened.  I&amp;#8217;d guess there are enough enthusiasts in the UK.  Anyone else out there interested?&lt;/p&gt;</description>
      <pubDate>Tue, 17 Jan 2006 09:46:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:b7d39a47b6800927b0e2fc2113c130c4</guid>
      <author>Graham Stratton</author>
      <link>http://grahamstratton.org/blog/public/articles/2006/01/17/one-thing-leads-to-another</link>
      <category>Conferences</category>
      <category>Rails</category>
      <category>Ruby</category>
      <category>Python</category>
    </item>
    <item>
      <title>My Shiny New Blog</title>
      <description>&lt;p&gt;I have a shiny new weblog!  I&amp;#8217;m not sure that I approve of the fixed-width design, but I&amp;#8217;ll sort that out later.&lt;/p&gt;


	&lt;p&gt;The blog is powered by Typo, which is built on the Ruby on Rails framework. It took a little bit of installing.  The first problem was that irb, the interactive ruby interpreter, was not installed, but in production mode rails does not give you any hints, it just returns status 500 (internal server error) for all requests.&lt;/p&gt;


	&lt;p&gt;Running in development mode I got a traceback and fixed the problem, but then I again got status 500s with no indication of the problem.  Attempting to run the test suite showed the issue: rails not being able to find mysql.sock.  I would have thought that happened enough that a useful error message could be given.  Anyway, a peek at my.cnf gave the required information, and adding the socket: line to database.yml fixed the problem.&lt;/p&gt;


	&lt;p&gt;After that it was merely a matter of finding the login code, concocting the correct phrase from some salt and my password, &lt;span class="caps"&gt;SHA1&lt;/span&gt;-ing it, and inserting it into the database.  Maybe there was a simpler way.&lt;/p&gt;</description>
      <pubDate>Mon, 16 Jan 2006 22:18:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:a699530ec893295b56552776fa77786e</guid>
      <author>Graham Stratton</author>
      <link>http://grahamstratton.org/blog/public/articles/2006/01/16/my-shiny-new-blog</link>
      <category>Typo</category>
      <category>Rails</category>
    </item>
  </channel>
</rss>
