# Deploying Ruby on rails on hostgator

**URL:** <https://www.ruby-forum.com/t/deploying-ruby-on-rails-on-hostgator/162740>\
**Category:** Deployment\
**Created:** [March 13, 2009, 10:19am UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-on-hostgator/162740 "2009-03-13T10:19:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![johny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@johny](https://www.ruby-forum.com/u/johny)\
**Post date:** [March 13, 2009, 10:19am UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-on-hostgator/162740/1 "2009-03-13T10:19:08Z")

</div>

I created a Ruby on rails application on my linux.  
here the what i did

1.first I log in to my ssh account  
2.create an application rails /home/myusername/webregistration  
3 cd webregistration  
4 cd …/public\_html  
5 ln â€“s …/webregistration/public mywebregistration  
6.upload my application develop locally using ftp.I overwite all except  
for the public folder.

7.upload the .htaccess on public folder  
on my .htaccess  
AddHandler fastcgi-script .fcgi  
AddHandler cgi-script .cgi  
Options +FollowSymLinks +ExecCGI  
RewriteEngine On  
RewriteRule ^$ index.html [QSA]  
RewriteRule ^([^.]+)$ $1.html [QSA]  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteRule ^(.\*)$ dispatch.cgi [QSA,L]  
on my routes.rb  
ActionController::Routing::Routes.draw do |map|  
map.resources :websites  
map.connect ‘mywebregistration/:controller/:action/:id’  
map.connect  
‘mywebregistration/:controller/:action/:id.:format’  
map.connect ‘:controller/:action/:id’  
map.connect ‘:controller/:action/:id.:format’  
end  
on my database.yml  
development:  
adapter: mysql  
database: username\_websiteregistration  
username: username\_johny  
password: \*\*\*\*\*\*\*\*  
host: myipaddress  
when I browse my page I got an error  
[http://DNS/mywebregistration/websites/](http://DNS/mywebregistration/websites/)

LoadError in WebsitesController#index  
/usr/lib/libmysqlclient.so.16: version `libmysqlclient\_16’ not  
found (required by  
/usr/lib/ruby/site\_ruby/1.8/i686-linux/mysql.so) -  
/usr/lib/ruby/site\_ruby/1.8/i686-linux/mysql.so

full trace  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action\_controller/base.rb:524:in  
`process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in `process\_without\_session\_management\_support’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action\_controller/session\_management.rb:134:in  
`process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in `process’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action\_controller/dispatcher.rb:183:in  
`handle_request' /usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in `dispatch\_unlocked’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action\_controller/dispatcher.rb:123:in  
`dispatch' /usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in `synchronize’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action\_controller/dispatcher.rb:122:in  
`dispatch' /usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in `dispatch\_cgi’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action\_controller/dispatcher.rb:39:in  
`dispatch’  
dispatch.cgi:10

This error occurred while loading the following files:  
mysql

can anyone know how to solve it.

---

<div class="post-metadata">

**Author:** ![johny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@johny](https://www.ruby-forum.com/u/johny)\
**Post date:** [March 15, 2009, 2:17am UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-on-hostgator/162740/2 "2009-03-15T02:17:24Z")

</div>

have you tried localhost instead of ipaddress?

---

<div class="post-metadata">

**Author:** ![johny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@johny](https://www.ruby-forum.com/u/johny)\
**Post date:** [March 15, 2009, 2:20am UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-on-hostgator/162740/3 "2009-03-15T02:20:21Z")

</div>

I’m also trying to deploy my app at hostgator and I’m facing this error:

undefined method `paginate\_by\_sql’

I have installed will\_paginate both as a gem and plugin and in my local  
configuration the app works fine. Any idea?

---

<div class="post-metadata">

**Author:** ![johny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@johny](https://www.ruby-forum.com/u/johny)\
**Post date:** [March 16, 2009, 3:23am UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-on-hostgator/162740/4 "2009-03-16T03:23:52Z")

</div>

Dimitris Theodorakis wrote:

> have you tried localhost instead of ipaddress?  
> thank you very much for your reply  
> yes I try too but I got the same error.maybe if you had made a success  
> on deploying a RoR application locally develop and deploy on their linux  
> server please post an instructions on how.

---

<div class="post-metadata">

**Author:** ![johny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@johny](https://www.ruby-forum.com/u/johny)\
**Post date:** [March 16, 2009, 12:21pm UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-on-hostgator/162740/5 "2009-03-16T12:21:21Z")

</div>

Johny ben wrote:

> Dimitris Theodorakis wrote:
> 
> > have you tried localhost instead of ipaddress?  
> > thank you very much for your reply  
> > yes I try too but I got the same error.maybe if you had made a success  
> > on deploying a RoR application locally develop and deploy on their linux  
> > server please post an instructions on how.  
> > Finally after a weekend I have my rails app up and running.

I use exactly the same version as hostgator for rails, gems etc. So I  
did nothing like freezing rails or gem. My problem was the above. I was  
always getting an error as rails server didn’t include the path of  
/vendor/plugins. So we added this little magic line on my  
/config/environment.rb

“config.load\_paths += %W( #{RAILS\_ROOT}/vendor/plugins )” and everything  
works fine right now.

no .htaccesses added!

---

<div class="post-metadata">

**Author:** ![johny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@johny](https://www.ruby-forum.com/u/johny)\
**Post date:** [March 17, 2009, 2:21am UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-on-hostgator/162740/6 "2009-03-17T02:21:53Z")

</div>

wow great.  
Can you please elaborate detail by detail from start on how you upload  
the application.what is your development environment.how you upload your  
application through ftp or ssh.what modification you did.

again thank you very much

---

<div class="post-metadata">

**Author:** ![johny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@johny](https://www.ruby-forum.com/u/johny)\
**Post date:** [March 24, 2009, 1:31pm UTC](https://www.ruby-forum.com/t/deploying-ruby-on-rails-on-hostgator/162740/7 "2009-03-24T13:31:14Z")

</div>

Johny ben wrote:

> wow great.  
> Can you please elaborate detail by detail from start on how you upload  
> the application.what is your development environment.how you upload your  
> application through ftp or ssh.what modification you did.
> 
> again thank you very much

the process was really very simple. I use the same rails and gem  
versions so I didn’t have to freeze my project. I created a new RoR  
application (cpanel), I uploaded my app and replaced the files from the  
app that I had just created (~/etc/rail\_apps/sample\_app/). Then I  
created a symbolic link from the cpanel, I added the line from the above  
comment to my config/environment.rb and just everything works
