2

The tittle pretty much tells it all , I have been browsing on the internet for a couple of hours now but cant seem to find a article on it. What my problem is that I have a Ruby on rails project started on a remote server but when i run the "rails s" command it starts on

localhost(http:// 0.0.0.0:3000)

and I cant access that from my PC. There has to be some optional parameter or some configuration that I am missing on how I can start my project in development mode and access it with remote address.

Thank You for your time!

Pretzel
  • 8,141
  • 16
  • 59
  • 84
Csak Zoli
  • 408
  • 1
  • 4
  • 11
  • you want to remote debug your server? – Uri Agassi Jul 16 '14 at 13:21
  • 1
    If the port 3000 on the server is open, you can access with the public ip or domain name (e.g. thedomainname.com:3000). – S. A. Jul 16 '14 at 13:21
  • Please post that on as the answer thank you SO MUCH!! Sergio A – Csak Zoli Jul 16 '14 at 13:23
  • Possible duplicate of http://stackoverflow.com/questions/10078454/access-rails-development-server-from-a-different-computer – jkeuhlen Jul 16 '14 at 13:27
  • Look up localtunnel gem as well for servers without a domain name attached. – Chris Valentine Jul 16 '14 at 13:30
  • @nemes.zoltan: I just rolled back someone else's edit to your original post because I thought it radically altered your personal writing style. That said, you don't need to write "thanks" or include unnecessary explaining. Just try to keep things "short and sweet". Welcome to StackOverflow! :) – Pretzel Jul 16 '14 at 13:39
  • 1
    Hey sorry just wanted to be polite but oke I will keep it simple! – Csak Zoli Jul 16 '14 at 13:42

1 Answers1

2

If you run rails server -h it will give you the help message which has the necessary information.

Usage: rails server [mongrel, thin, etc] [options]
    -p, --port=port                  Runs Rails on the specified port.
                                     Default: 3000
    -b, --binding=ip                 Binds Rails to the specified ip.
                                     Default: 0.0.0.0
    -c, --config=file                Use custom rackup configuration file
    -d, --daemon                     Make server run as a Daemon.
    -u, --debugger                   Enable the debugger
    -e, --environment=name           Specifies the environment to run this server under (test/development/production).
                                     Default: development
    -P, --pid=pid                    Specifies the PID file.
                                     Default: tmp/pids/server.pid

    -h, --help                       Show this help message.

What you need to do is rails s -b IP# -p PORT#

Or like Sergio said in comments: domainname:3000

jkeuhlen
  • 4,401
  • 23
  • 36
  • Yeah if you have a domainname for your remote server than that works. I was thinking of you specifying the IP address you wanted to open it on. My way works if you dont have the domain name – jkeuhlen Jul 16 '14 at 13:31