<?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>Benjamin McCann - Development Blog &#187; Ruby on Rails</title>
	<atom:link href="http://www.benmccann.com/dev-blog/category/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benmccann.com/dev-blog</link>
	<description>The software development weblog of Benjamin McCann.</description>
	<lastBuildDate>Sun, 29 Aug 2010 17:40:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Hosting Ruby on Rails on Shared Hosting at FastDomain</title>
		<link>http://www.benmccann.com/dev-blog/hosting-ruby-on-rails-on-shared-hosting-at-fastdomain/</link>
		<comments>http://www.benmccann.com/dev-blog/hosting-ruby-on-rails-on-shared-hosting-at-fastdomain/#comments</comments>
		<pubDate>Sun, 06 Apr 2008 02:18:58 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.lumidant.com/blog/hosting-ruby-on-rails-on-shared-hosting-at-fastdomain/</guid>
		<description><![CDATA[I&#8217;ve been playing around with Ruby on Rails lately. I&#8217;m using Instant Rails as a development server locally. However, I wanted to try to publish my first Rails app to the world. I have a shared hosting account at FastDomain.com, but was having a lot of trouble getting it to work. The only error message [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with Ruby on Rails lately.  I&#8217;m using <a href="http://instantrails.rubyforge.org">Instant Rails</a> as a development server locally.  However, I wanted to try to publish my first Rails app to the world.  I have a shared hosting account at FastDomain.com, but was having a lot of trouble getting it to work. The only error message I was given was &#8220;Application Error &#8211; <strong>Rails application failed to start properly</strong>&#8221; and I couldn&#8217;t find any informative logs.  I believe that Fast Domain is run by the same people who run the more well-known BlueHost.com, so these instructions should work for that host too.</p>
<p>After awhile, I figured out that my problem was due to the fact that the permissions were not set properly when I FTP&#8217;d the app over.  So, I deleted the app and ran &#8220;rails appname&#8221; to generate the basic rails structure.  Then I copied over my app, config, and vendor/plugins directories and the relevant portions of the public directory.  After that I was up and running.  Make sure not to copy the entire public directory, but only the files you&#8217;ve created or edited so that you do not change the permissions of the dispatch scripts.    You could also copy everything and run &#8220;chmod 755&#8243; afterwards to reset the permissions. If you&#8217;re getting a similar error and the steps I described did not help then I recommend checking out <a href="http://6brand.com/application-error-rails-app-failed-to-start-properly">this page</a> at Hoopla!</p>
<p>At this point I was up and running, but my app was sloooowwww.  The solution I found was to modify the .htaccess file to ensure that fcgi was being used instead of cgi.  Makes sense since the f in fcgi stands for fast.  So, go to the public directory of your app and change &#8220;RewriteRule ^(.*)$ dispatch.cgi [QSA,L]&#8221; to &#8220;RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]&#8220;.  At this point, when I visited the site, I was shown the script source instead of having it execute.  Turns out that FastDomain uses a different fcgi handler so change the first line of the script (&#8220;AddHandler fastcgi-script .fcgi&#8221;) to &#8220;AddHandler fcgid-script .fcgi&#8221; and your app will be blazing fast.</p>
<p>The most frustrating problem I experienced is that all of my Rails pages were being cached and static content was not.  This made updates to the site very difficult.  For example, if I updated a Rails page and a JavaScript file on that page then the two would be out of sync.  I haven&#8217;t found an easy way to clear the Ruby on Rails cache at BlueHost/FastDomain.  The answer I came up with was to run &#8220;ps -ef | grep ruby&#8221;, to find the Rails process that was running.  Then look at the pid and use it to kill the process such as &#8220;kill 24018&#8243;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benmccann.com/dev-blog/hosting-ruby-on-rails-on-shared-hosting-at-fastdomain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
