Create a new ruby on rails project using MySQL on the one click ruby on rails option

February 7, 2016 814 views
Ruby on Rails Ruby PostgreSQL MySQL Ubuntu


I used the ruby on rails one click option to set up an environment. Though I don't want to use postgres/the original project I want to use MySQL. I installed MySQL and set up a new rails project. I deleted the original projects(/home/rails/railsproject.) but the website stills stays the same(says the project is coming from /home/rails/railsproject/app/views/home/index.html.erb)... These files no longer exist so how is this possible? and how can I point the server to my new project?

2 Answers

It sounds like the issue that your hitting is related to the Nginx configuration on the droplet. In order for Nginx to know about the new location of your Rails app you will need to update the config file located at /etc/nginx/sites-enabled/rails.

Along with updating the Nginx configuration, the Unicorn config file will need to updated as well. The Unicorn config file can be found at ``/etc/unicorn.conf

Don't forget to restart the services to load the new configuration.

You need to restart Unicorn. Until you restart, the old files will still show.

service unicorn restart

As long as you put your new project in /home/rails/rails_project, you don't need to change anything on the server, assuming you are using the 1-click Rails App image.

Have another answer? Share your knowledge.