Hopefully a simple ruby on rails question..

Soldato
Joined
18 Oct 2002
Posts
9,047
Location
London
I have an application running on my machine, very simple one. i.e. It took longer to set up RoR than it did to make it... ;)

My webserver supports RoR, but I haven't a clue how you go about "running" it there? I transferred the entire folder structure there, hoping it would "just work" PHP style. But I guess I'm missing a vital step?

Any help would be great, I don't really know what to do. Usually I just use the cmd.exe and use 'ruby script/server' on localhost..
 
Basically you can either configure your webserver (for example apache/fastcgi) or you can install a webserver like mongrel that is specifically for ruby/rails.

Obviously configuring your server depends on the httpd software your using.
 
Well my hosting is tsohost with apache/cpanel. I'm just unsure where to "go" really. It's a lot easier on your own machine (using webrick). Is there some guide or something for putting your work onto a proper host?
 
I don't think you can run Ruby on Rails with TSOHost. I canceled account for that very reason... that was nearly a year ago though.

With dreamhost you have to SSH in via a terminal to setup the application. I haven't done it for quite a while so I can't really remember the ins and outs of it.
 
Yeah the old server I was on didn't support it, but I recently moved to one with php5 and RoR. I guess I'll have to wait for a reply from the support there.
 
Yeah it obviously depends on your webhost since you can't go around changing their httpd config files. VPS hosting seems to be the best way to go if you must have shared hosting with ruby rails since that way you can install any gems/make config changes as much as you requirement.
 
I have SSH access it turns out.

So I made a simple app 'rails test' and generated a controller with a simple index def to 'render_test "hello"'
But I'm still left with just a bunch of files, and I'm unsure how to "run" it. Using 'ruby script/server' starts webrick, but it looked like it was running on localhost and it didn't seem to effect my application.

I can't believe how hard it is to find a straight forward tutorial on the web for this kind of thing. I found this on dreamhost, but it doesn't seem to relate to my setup http://www.railshosting.org/#dreamhost
 
As I said it depends on the webserver.....

Apache is very different from Mongrel, LightHTTP is different from Mongrel....

No one solution works for all, when you start providing proper information people will be able to help you better.

Also if you had read script/server --help you would have seen that -b specifys the ip to listen on... default will go to localhost yes.
 
Last edited:
Oh right, well yeah it's just normal apache. Standard shared web hosting with cpanel+ssh.. Are you saying that I just have to do something like this?

ruby script/server -b <shared hosting ip>

That runs, but then going to /app/ doesn't do anything or /app/public/ very very confused.
 
It should work providing your binding the server on the correct port/ip? Can you view all the default stuff?

Webrick is only decent for development, you do not want to use it for production. There are plenty of guides out there to set apache up for rails, however unless you got root access to your server (which is very unlikely) you will have to follow the instructions given by your webhost on how to setup a rails app correctly.
 
Back
Top Bottom