Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy Rails Application on Bluehost

I am trying to deploy my RoR application in Bluehost but I´m having some trouble. I want my Rails application to be accessible from a top-level domain, that is to be access once someone access my website URL. I have followed several tutorials, and tried several approaches, but I´m still getting no where. When I access my URL (http://hotelelcidacapulco.com/) I get the following message: No such file or directory - config.ru

I assume it must be a problem of the Symlink. I´ve tried different symlinks however I think it should be:

ln -s ~/path/appName/public appname so something like this: ln -s ~/rails_apps/ElCid/public ElCid

But I get again the error message message: No such file or directory - config.ru

Again, I´m deffinitely no expert but I assume it has something to do with the symlink. I´ve been struggling a lot, and would really appreciate the help as I need to get it runnning as soon as possible.

Here are my files:

/home3/hotelelc/public_html/.htaccess File:

SetEnv GEM_HOME /home3/hotelelc/ruby/gems

<IfModule mod_passenger.c>
Options -MultiViews
PassengerResolveSymlinksInDocumentRoot on
RailsEnv production
RackBaseURI /
SetEnv GEM_HOME /home3/hotelelc/ruby/gems
</IfModule>

AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)/!$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
ErrorDocument 500 "Application error Application failed to start properly"

/home3/hotelelc/.bashrc File:

export HPATH=/home3/hotelelc/
export GEM_HOME=$HPATH/ruby/gemsexport GEM_HOME=$HPATH/ruby/gems
export GEM_PATH=$GEM_HOME:/usr/lib64/ruby/gems/1.8
export GEM_CACHE=$GEM_HOME/cache
export PATH=$PATH:$HPATH/ruby/gems/bin
export PATH=$PATH:$HPATH/ruby/gems

if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

Finally, this is my /config/environment.rb File:

require File.expand_path('../application', __FILE__)

ElCid::Application.initialize!

ENV['GEM_PATH'] = '/home3/hotelelc/ruby/gems:/usr/lib64/ruby/gems/1.8'
like image 369
Sebastian Ruiz Avatar asked Mar 06 '12 19:03

Sebastian Ruiz


People also ask

Does Bluehost support Ruby on Rails?

Access Your RoR ApplicationLog into your Bluehost control panel. Select Subdomains from the Domains section. From the dropdown box, select which domain you want to create that subdomain on. Make sure the Document Root box points to the folder you want the subdomain to be tied to.

Does Hostinger support Ruby on Rails?

Though Hostinger doesn't support Ruby on Rails hosting on its shared servers, a quick glance at the available VPS hosting plans will quickly convince you that you aren't missing out on much.

Can you make apps with Ruby on Rails?

Rails is a web application development framework written in the Ruby programming language. It is designed to make programming web applications easier by making assumptions about what every developer needs to get started. It allows you to write less code while accomplishing more than many other languages and frameworks.


1 Answers

Try moving your .htaccess file to the public directory of your app instead of public_html. I believe this will be app/public/.htaccess. Hope it helps!

Yeah I know this is an old question, but for future readers.

like image 97
derek_duncan Avatar answered Oct 01 '22 00:10

derek_duncan