Install PostgreSQL:
sudo zypper install postgresql-server postgresql-devel
Start the database server:
sudo systemctl start postgresql
Enable server to be started on boot:
sudo systemctl enable postgresql
Switch to the postgres user to set up the database:
sudo su -l postgres
Create database user:
createuser -d USERNAME
Return to your normal user, exchange the database driver in the Gemfile from sqlite3 to pg and run
bundle install
Change the configuration of the database driver to something like:
default: &default adapter: postgresql username: cs development: <<: *default database: APPNAME_development test: <<: *default database: APPNAME_test production: <<: *default database: APPNAME_productionCreate the databases:
rake db:create
rake db:migrate
rake db:migrate RAILS_ENV=test
That's it.
That's nice but I still wonder why it's so hard to setup RoR on a production server like apache or nginx using passenger. A ready to use SuSE studio appliance would be great :)
ReplyDeleteWhat exactly do you find hard there? There should be packages for everything you need, and configuration will vary depending on what your application does.
DeleteAn appliance would be great as a start. For a real production setup you will need more, though, so the application can be made scalable and highly available.
Thank you for the good article.
ReplyDelete