Help access droplet IP from browser, configuring Rails in CentOS.

January 25, 2015 1.6k views

Hi, sorry if this question seems TOO basic. My knowledge is very little about servers and environments, I come from frontend area.

I'm trying to learn how to configure Rails + Unicorn + Nginx in CentOS. I'm following this tutorial

The first thing I did was to create an empty droplet with CentOS, latest version. Following the tutorial, those are the steps I've done:

  1. yum -y update
  2. yum groupinstall -y 'development tools'
  3. sudo su -c 'rpm -Uvh' (it showed me this log: file /etc/rpm/macros.ghc-srpm from install of epel-release-6-8.noarch conflicts with file from package redhat-rpm-config-9.1.0-63.el7.centos.noarch)
  4. yum install -y curl-devel nano sqlite-devel libyaml-devel
  5. Followed these tutorials to install ruby and nodejs.
  6. gem install bundler rails
  7. yum install -y nginx
  8. gem install unicorn
  9. Created rails app with scaffold content.
  10. RAILS_ENV=development rake db:migrate
  11. RAILS_ENV=production rake db:migrate
  12. mkdir pids (inside Rails app, is it correct?)

Finally I ran the application with "rails s". After that, according the tutorial in "Creating A Sample Application" says that I should be able to see the application in the browser from http://[your droplet's IP]:3000/tasks. But I can not, Firefox shows me this message: "Unable to connect - Firefox can't establish a connection to the server at xxxxx"

What am I doing wrong? What I need to do?


  • What is the output of running rails s in the Rails app's directory?

  • Hi i have the same issue the output for mine is
    => Booting WEBrick
    => Rails 4.2.0.beta4 application starting in development on http://localhost:3000
    => Run rails server -h for more startup options
    => Ctrl-C to shutdown server
    [2015-02-01 22:37:43] INFO WEBrick 1.3.1
    [2015-02-01 22:37:43] INFO ruby 2.1.4 (2014-10-27) [x86_64-linux]
    [2015-02-01 22:37:43] INFO WEBrick::HTTPServer#start: pid=17205 port=3000

  • Hi, after some hours, I have to share my experience as an nginx noob.

    In my case I tried to see in the browser the application as the tutorial suggested, but how could I? if Nginx and Unicorn weren't installed yet in that part of the tutorial. I had to finish all tutorial to make it work.
    But in my case, I could not test it in browser with rails s, only with unicorn_rails.

  • the thing is... this tutorial implies that binding to the public IP as a test will work with webrick. The tutorial really should not imply that if its not the case. ok, whine_session poweroff

    Ruby on Rails uses sqlite3 as its default database, which works great in many cases, but may not be sufficient for your application. If your application requires the scalability, centralization, and control (or any other feature) that is provided by a client/server SQL database offers, this tutorial will show you how to do just that, with PostgreSQL, on Ubuntu 14.04.
Be the first one to answer this question.