I have my beginner Ruby application working perfectly on my local server using Rack and Sinatra. I’m in the process of getting it to work on my VPS webhost.
Here are my questions:
-
I tried running:
rackup config.ruvia SSH, and nothing happens, it just shows an empty line and I have to hit CNTRL+C to abort. Does anyone have ideas why?
If I run
ruby main.rb, it successfully says Sinatra is taking the stage, but that’s it, so I know you can’t have it working with JUST that, but at least Sinatra is working properly. -
I have a public_html folder. Is the main.rb and config.ru supposed to go in root “/” or is it supposed to go in public_html?
If it’s the later, and I put a blank index.html inside public_html, will rackup know to ‘replace’ it with main.rb in / when it’s running, and if it’s not it just displays the index.html in public_html
-
When all is up and running, do I need to access the Ruby app via site.com:xxxx (xxxx=whatever port), or will I simply be able to go to site.com
You dont really need my code for main.rb, it just outputs “hello”
Here’s config.ru:
require File.dirname(__FILE__) + "/main" run Sinatra::Application
Q1, just
rackupwithoutconfig.ruQ2, in general, the static folder name is
public, notpublic_htmlunless you set it manually. other files, such as the main.rb, that is supposed to put into root directory, stay with the config.ru in the same folder if the code of main.rb as your given.Q3, access by
http://0.0.0.0:9292/if you use therackupby default setting to rack up the web server