Deploy Rails Application on Bluehost
Asked Answered
D

1

8

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'
Downgrade answered 6/3, 2012 at 19:48 Comment(3)
Shouldn't RackBaseURI be /public?Reticent
I tried RackBaseURI as /public and it broke. Just a note for future readers.Oceanus
I have used Bluehost and like it, but I don't think it will be worth it for all the trouble. Check out something like digitalocean.com if cost is an issue.Arkansas
C
1

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.

Chthonian answered 16/4, 2013 at 3:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.