Deploy: First Rails App to shared server

I installed

ruby: 1.8.7
rails: 2.3.8
gems: 1.3.5

on the Ubuntu with passenger 2.2.15

now i create the first demo application,

i create a folder on home “ruby”->“demo”

than i created a sites-available

udo nano /etc/apache2/sites-available/demo

<VirtualHost *:80>

ServerName mydomain.com
ServerAlias www.mydomain.com

DocumentRoot /home/ruby/demo/public

i am looking for next step … where to go from here and also please
help me if i am doing these steps wrong

i also run the demo project by apache2 server by

placing application in /var/www

and it works fine.

but how i move to this my shared hosting server
and run online

Thanks

That really depends on your hosting provider, you’ll probably need to
contact them and ask them about it.

If your current hosting provider does not offer the option to run your
setup you can either look for a hosting provider that does offer Ruby on
Rails (I know a number of them exist, others on the list may be able to
mention a few) or get a VPS hosting provider such as Linode
(http://www.linode.com) where you can install the setup yourself (when
choosing a VPS provider you’'ll need to be prepared to maintain all the
software on the VPS yourself though).

I hope this helps :slight_smile:

Hi ,

Did you deployed application on apache server? is that is running
locally?

On Sat, Jun 26, 2010 at 3:37 AM, Ali I. [email protected]
wrote:

i create a folder on home “ruby”->“demo”
DocumentRoot /home/ruby/demo/public
and it works fine.

http://groups.google.com/group/rubyonrails-talk?hl=en.


Thanks & Regards,
MuraliDharaRao.T
+91-9642234646

I have two hosting accounts,

one with godaddy and other with site5.com

I install locally apache2…
and i have two hosting accounts i can use any one …

i have one with site5.com and other one is godaddy.com

what step i need to take now please help me … its driving me crazy…

Hi,

Run the mongrel server in the port which you have configured earlier,
either
8000,8001,8002 or 3000,3001,3002, based on your mongrel_cluster
configuration. once you run that server locally or by using pid in
(linux)
machine. Then run the appache server. If every thing wil fine from
apache
you will talk to your rails application.

On Sun, Jun 27, 2010 at 8:58 AM, Ali I. [email protected]
wrote:

than i created a sites-available

but how i move to this my shared hosting server
To unsubscribe from this group, send email to


Thanks & Regards,
MuraliDharaRao.T
+91-9642234646

If they’re standard shared host hosting accounts you won’t be able to
change the Apache configuration as you desire, you’ll need to ask the
hosting company to do it for you.

I deployed on Site5, so it’s possible :slight_smile:

Search their bulletin board for a tutorial, i can’t remember the link
off hand, if you have trouble let me know.

If you are developing locally you don’t need apache, just go to your
app in the terminal and say$ script/server

This is a pretty good getting started guide:

But anyway… check the Site5 forum it worked for me, you can try
using the cpanel to start off your rails app, and it will setup a
subdomain for you. if your get that app working, replace the contents
of the folder with your own…

I ssh’ed into site5 and linked the folder created by the cpanel wizard
to my own rails ‘public’ folder outside the www folder, if i remember
correctly. Theres no need for your rails app to be available to
apache. Then you probably want to look into their passenger server
restart method… where you’re supposed to make a file called
restart.txt or something, and put it somewhere, I can’t remember
exactly I think I moved it from the default location… again, the
forums are a good resource :slight_smile: – then you just ssh again and unix
“touch” it and bam the server restarts… you might not want this
file to be in the www folder either :wink:

Good luck,

  • V

PS,

You can also try figuring out how to set up a git repo on that server
and then checkout a copy beside it and make that copy your production,
then on your local machine git checkout from the server through ssh
and bam, you can make changes on the local version commit, push, go to
remote git pull and there’s your updated app, version controlled
deployment, closest to heroku without the coolne$$ of heroku :wink:

If you have ssh access then you could also use Capistrano for
application deployment

Which settings i need to change

My hosting does not support mongrel. they jus told me to use Passenger
and i have no idea what steps i need to take…

Thanks

If you go to google. you can type: “site5 rails deploy” and the first
hit you get is the answer…

Did you try to do what that post sais? Also try to be perceptive of
any minute differences in your environment or how you might like to
make things work for you better… you don’t have or if the info is a
bit outdate, be following things strictly, try to adapt the tutorial
to what you need. Let me know if the tutorial doesn’t do it for you
still.

  • V

thanks for the reply.

I read the completely link you send me. and i also looked at the
site5.com forum and still looking at it but did not find any help to
deploy the application . I tried all the ways i know…

I follow all the steps and got this error

The application has exited during startup (i.e. during the evaluation
of config/environment.rb). The error message can be found below. To
solve this problem, please follow any instructions in the error
message.
Error message:
Missing the Rails 2.2.3 gem. Please gem install -v=2.2.3 rails,
update your RAILS_GEM_VERSION setting in config/environment.rb for the
Rails version you do have installed, or comment out RAILS_GEM_VERSION
to use the latest version installed.
Application root:
/home/realhotr/demo

Well, it looks like you’re using rails 2.2.3 in your config/
environment.rb file.

You can either update that version number in the environment.rb file
to match 2.3.8, the rails version you say you have installed on your
host, and deploy.

Or “gem install -v=2.2.3 rails” on your server and hope for the
best. :slight_smile:

good luck,

Lake

Yes :slight_smile: the error message tells you exactly what you have to do, just
like Lake did.

Thanks buddy, it is working.