Question

I am really struggling to understand this.

I have used PHP / Apache all my life but I just need to have a very basic setup of a Ruby on Rails app on an Nginx server for development.

I have set up an Ubuntu 12.04 server with Vagrant / VirtualBox.

I can see in the web browser the "Welcome to nginx!" message and there's a Ruby on Rails app installed on the server (tested with someone else and working on there server).

The Ruby on Rails application is in an /app/ folder and with these folders:

- assets
- controllers
- helpers
- mailers
- models
- observers
- uploaders
- views

Now, all I need to do is run the thing. Where is my index file?

Are there any other folders I should take note of? There's nothing I can see.

I've tried configuring sites-enabled but none of it makes sense. Surely it should be a simple case of getting my-domain.com to display the index file. Simple, surely? Which file in the /app/ folder am I trying to run?

Was it helpful?

Solution

For development you can use the built-in web-server with rails s in your project folder. It will runs your RoR app on 0.0.0.0:3000. Port can be changed with -p (rails s -p 80).

OTHER TIPS

Read this guide to running rails on nginx using passenger:

Once Ruby on Rails is installed, go ahead and install passenger.

gem install passenger 

...

Set the root to the public directory of your new rails project. Your config should then look something like this:

server { 
listen 80; 
server_name example.com; 
passenger_enabled on; 
root /var/www/my_awesome_rails_app/public; 
}

(Don't forget the /public after the rails root location!)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top