# Dreamhost Deployment Issues

**URL:** <https://www.ruby-forum.com/t/dreamhost-deployment-issues/73816>\
**Category:** Rails\
**Created:** [October 27, 2006, 9:11am UTC](https://www.ruby-forum.com/t/dreamhost-deployment-issues/73816 "2006-10-27T09:11:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![deniedlates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@deniedlates](https://www.ruby-forum.com/u/deniedlates)\
**Post date:** [October 27, 2006, 9:11am UTC](https://www.ruby-forum.com/t/dreamhost-deployment-issues/73816/1 "2006-10-27T09:11:55Z")

</div>

Hi,

After following the quickstart guide in the Dreamhost wiki:

[http://wiki.dreamhost.com/index.php/Rails#Quick\_Start\_Guide\_August\_2006](http://wiki.dreamhost.com/index.php/Rails#Quick_Start_Guide_August_2006)

and browsing through old posts on this forum, I am unable to install a  
working Rails application on my Dreamhost account. I have an  
application with two models and three controllers that I cannot get to  
work. I even tried creating a simple application with one model and one  
controller, and that didn’t work either.

Has anyone recently deployed a Rails application on Dreamhost? Are  
there any errors in the quick start guide (linked above) that I need to  
be aware of? Thanks in advance…

Brandon

---

<div class="post-metadata">

**Author:** ![deniedlates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@deniedlates](https://www.ruby-forum.com/u/deniedlates)\
**Post date:** [October 27, 2006, 9:43am UTC](https://www.ruby-forum.com/t/dreamhost-deployment-issues/73816/2 "2006-10-27T09:43:12Z")

</div>

On 27 Oct 2006, at 8:11 am, Brandon S. wrote:

> application with two models and three controllers that I cannot get to
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

I’ve set up a RoR application on my Dreamhost account and it worked  
OK - mine is at [http://search.chooseyournursery.com/](http://search.chooseyournursery.com/). I have only put  
the framework in place but it looked just like it looks on my local  
machine.

Are you setting it up as a sub-domain or as a sub-directory?

## Ian.

---

<div class="post-metadata">

**Author:** ![deniedlates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@deniedlates](https://www.ruby-forum.com/u/deniedlates)\
**Post date:** [October 27, 2006, 9:51am UTC](https://www.ruby-forum.com/t/dreamhost-deployment-issues/73816/3 "2006-10-27T09:51:07Z")

</div>

> I’ve set up a RoR application on my Dreamhost account and it worked  
> OK - mine is at [http://search.chooseyournursery.com/](http://search.chooseyournursery.com/). I have only put  
> the framework in place but it looked just like it looks on my local  
> machine.

Ian,

I have the application setup on a subdomain, just like yours. The root  
directory is setup like: [subdomain.domain.com/public/](http://subdomain.domain.com/public/)

Did you follow the quick start guide on the DH wiki to get your app up  
and running? If not, where did you find instructions?

Thanks,  
Brandon

---

<div class="post-metadata">

**Author:** ![deniedlates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@deniedlates](https://www.ruby-forum.com/u/deniedlates)\
**Post date:** [October 27, 2006, 4:17pm UTC](https://www.ruby-forum.com/t/dreamhost-deployment-issues/73816/4 "2006-10-27T16:17:06Z")

</div>

Brian H. wrote:

> Please be specific about what won’t work. I’m sure I can help you once  
> you’ve given me more to go on.
> 
> 1. Did you edit config/environment.rb and set the app to production  
> mode?
> 2. Did you edit public/.htaccess and change dispatch.cgi to  
> dispatch.fcgi?
> 3. Did you set public/dispatch.\* to chmod 755?
> 
> Can you even get the “welcome to Rails” page to display? It’s just HTML  
> and  
> should be enough to prove that the subdomain is mounted properly.

Hi Brian,

I can get the “Welcome to Rails” page to display as soon as I create my  
new rails app on the server. However, I still can’t get the application  
to work. Here is what I’m doing:

1. Create new rails app on the server
2. Change instance of dispatch.cgi to dispatch.fcgi in public/.htaccess
3. Set application to production mode in config/environment.rb
4. Run this command: chmod -R u+rwX,go-w public log (from the DH wiki,  
This command sets the public directory and dispatch.fcgi to not be  
world-writable (or group-writable, just in case), and the log directory  
to be writable so that log and crash files can be generated.)
5. Edit config/database.yml with the correct database information.

After all of these steps, the “Welcome to Rails” page still displays.  
If I try to create a new scaffold, I get a mysql connection error:

Can’t connect to local MySQL server through socket  
‘/var/run/mysqld/mysqld.sock’

I have verified and reverified my database configuration and everything  
is correct in config/database.yml.

I don’t know what I’m doing wrong… please help!

---

<div class="post-metadata">

**Author:** ![deniedlates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@deniedlates](https://www.ruby-forum.com/u/deniedlates)\
**Post date:** [October 27, 2006, 5:33pm UTC](https://www.ruby-forum.com/t/dreamhost-deployment-issues/73816/5 "2006-10-27T17:33:53Z")

</div>

Oh 🙂 That’s easy.

You can’t use socket: in your database.yml file. You need to use host:  
[yourdb.yourdomain.com](http://yourdb.yourdomain.com)

Let me know if that needs to be more clear. Your mysql database is on a  
different machine than your web account so you need to use the hostname  
of  
the server, not a socket.

---

<div class="post-metadata">

**Author:** ![deniedlates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@deniedlates](https://www.ruby-forum.com/u/deniedlates)\
**Post date:** [October 27, 2006, 2:19pm UTC](https://www.ruby-forum.com/t/dreamhost-deployment-issues/73816/6 "2006-10-27T14:19:30Z")

</div>

Please be specific about what won’t work. I’m sure I can help you once  
you’ve given me more to go on.

1. Did you edit config/environment.rb and set the app to production  
mode?
2. Did you edit public/.htaccess and change dispatch.cgi to  
dispatch.fcgi?
3. Did you set public/dispatch.\* to chmod 755?

Can you even get the “welcome to Rails” page to display? It’s just HTML  
and  
should be enough to prove that the subdomain is mounted properly.

---

<div class="post-metadata">

**Author:** ![deniedlates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@deniedlates](https://www.ruby-forum.com/u/deniedlates)\
**Post date:** [October 27, 2006, 5:42pm UTC](https://www.ruby-forum.com/t/dreamhost-deployment-issues/73816/7 "2006-10-27T17:42:17Z")

</div>

Brian H. wrote:

> Oh 🙂 That’s easy.
> 
> You can’t use socket: in your database.yml file. You need to use host:  
> [yourdb.yourdomain.com](http://yourdb.yourdomain.com)
> 
> Let me know if that needs to be more clear. Your mysql database is on a  
> different machine than your web account so you need to use the hostname  
> of  
> the server, not a socket.

Brian,

Thanks for the help… I was using the hostname of the database the  
whole time, but it still wasn’t working. I FINALLY got my Rails app  
deployed succesfully. I needed to kill some dispatch.fcgi processes to  
get everything working.

Thanks again,  
Brandon
