Question

Can't launch Rails app with Nginx and passenger

  • Posted September 12, 2013

Installed nginx, passenger 4.0.17, node, rails 4 and ruby 2, git and all gems.

nginx config:

server {
        listen 80;
        server_name  162.243.1.111;
	root /home/abachuk/myapp/public;
	passenger_enabled on;
	rails_env production;
}
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1828/nginx ```

what else is missing?
Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I was able to make it work. Here are details for those who have same issues <br>http://alexbachuk.com/launch-rails-4-application-with-passenger-and-nginx/

Do you have any symbolic links in <code>/home/abachuk/myapp/public</code>?

yes. I also tried to launch with one click install. Rails 3 works fine. But rails 4 doesn’t work anywhere. Not sure why. I guess I missed something. I created 3 droplets and tried to launch the app in 3 different ways. Unicorn, passenger, apache. Nothing works. I would appreciate any help. Thanks.

Did you follow this tutorial: <a href=“https://www.digitalocean.com/community/articles/how-to-install-rails-and-nginx-with-passenger-on-ubuntu”>How To Install Rails and nginx with Passenger on Ubuntu</a>?

nginx.config - I have <br>passenger_root /home/abachuk/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.17; <br>passenger_ruby /home/abachuk/.rvm/wrappers/ruby-2.0.0-p247/ruby; <br> <br>/etc/nginx/sites-enabled - empty

Also, what’s the contents of <code>/etc/nginx/sites-enabled</code>?

In <code>nginx.conf</code>, have you uncommented the lines?: <br> <br><code>#passenger_root /usr;</code> <br><code>#passenger_ruby /usr/bin/ruby;</code> <br> <br>If not, do so & restart Nginx.

changed. Now I have. Restarted nginx and still see 403 forbidden. <br>drwxr-xr-x 9 www-data www-data 4096 Sep 11 11:36 app <br>drwxr-xr-x 2 www-data www-data 4096 Sep 11 11:36 bin <br>drwxr-xr-x 5 www-data www-data 4096 Sep 11 11:36 config <br>-rwxr-xr-x 1 www-data www-data 161 Sep 11 11:36 config.ru <br>drwxr-xr-x 3 www-data www-data 4096 Sep 12 02:11 db <br>-rwxr-xr-x 1 www-data www-data 1474 Sep 12 02:41 Gemfile <br>-rwxr-xr-x 1 www-data www-data 4622 Sep 12 02:53 Gemfile.lock <br>drwxr-xr-x 4 www-data www-data 4096 Sep 11 11:36 lib <br>drwxr-xr-x 2 www-data www-data 4096 Sep 11 11:36 log <br>drwxr-xr-x 3 www-data www-data 4096 Sep 11 11:36 public <br>-rwxr-xr-x 1 www-data www-data 256 Sep 11 11:36 Rakefile <br>-rwxr-xr-x 1 www-data www-data 24 Sep 11 11:36 README.md <br>-rwxr-xr-x 1 www-data www-data 478 Sep 11 11:36 README.rdoc <br>drwxr-xr-x 8 www-data www-data 4096 Sep 11 11:36 test <br>drwxr-xr-x 6 www-data www-data 4096 Sep 11 11:36 tmp <br>drwxr-xr-x 3 www-data www-data 4096 Sep 11 11:37 vendor

Shouldn’t <code>owner:group</code> be <code>www-data:www-data</code>; instead of <code>abachuk:abachuk</code>?

the output is. Made public folder (chmod -R 755) ‘public’ <br>drwxr-xr-x 9 abachuk abachuk 4096 Sep 11 11:36 app <br>drwxr-xr-x 2 abachuk abachuk 4096 Sep 11 11:36 bin <br>drwxr-xr-x 5 abachuk abachuk 4096 Sep 11 11:36 config <br>-rwxr-xr-x 1 abachuk abachuk 161 Sep 11 11:36 config.ru <br>drwxr-xr-x 3 abachuk abachuk 4096 Sep 12 02:11 db <br>-rwxr-xr-x 1 abachuk abachuk 1474 Sep 12 02:41 Gemfile <br>-rwxr-xr-x 1 abachuk abachuk 4622 Sep 12 02:53 Gemfile.lock <br>drwxr-xr-x 4 abachuk abachuk 4096 Sep 11 11:36 lib <br>drwxr-xr-x 2 abachuk abachuk 4096 Sep 11 11:36 log <br>drwxr-xr-x 3 abachuk abachuk 4096 Sep 11 11:36 public <br>-rwxr-xr-x 1 abachuk abachuk 256 Sep 11 11:36 Rakefile <br>-rwxr-xr-x 1 abachuk abachuk 24 Sep 11 11:36 README.md <br>-rwxr-xr-x 1 abachuk abachuk 478 Sep 11 11:36 README.rdoc <br>drwxr-xr-x 8 abachuk abachuk 4096 Sep 11 11:36 test <br>drwxr-xr-x 6 abachuk abachuk 4096 Sep 11 11:36 tmp <br>drwxr-xr-x 3 abachuk abachuk 4096 Sep 11 11:37 vendor