Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Ezekiel dela Peña
Ezekiel dela Peña
6,231 Points

Somewhat related to Ruby. Installing postgresql.

Is there any tutorial you can recommend when installing postgresql for Ruby on Rails development?

I'm kinda having a hard time finding one. btw I'm trying to install it with my Windows laptop. Thanks in advance! :)

2 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Postgresql in itself is not so easy to set up properly, gorails.com has very good tutorials for this (as part of "Setup Ruby on Rails", like here: https://gorails.com/setup/ubuntu/15.04). But you're on Windows...and the first commandment of Rails development should be "Thou shalt not use Windows" - it introduces a lot of problems and errors that you can't really Google and get good answers for, since most Rails developers don't use Windows. Consider moving to a Unix-based system. Linux works great, I personally recommend Ubuntu. A lot of help online. Can't help you with Windows - I tried to develop Rails on Windows once, failed epically and moved to Linux.

Nathan F.
Nathan F.
30,773 Points

I agree with this advice. Developing for Rails or anything that depends a lot on command line tools is a pain in the neck on Windows.

Ezekiel dela Peña
Ezekiel dela Peña
6,231 Points

Ok thanks! :) will try this on ubuntu.

Nathan F.
Nathan F.
30,773 Points

For Mac, it's quite simple. Just run the following in your terminal:

brew install postgresql

Not running the above results in errors when trying to install the necessary gems, and a similar case for mysql as well. Once brewing has finished, install the gem and specify a version if necessary.

gem install pg

For Windows, things get a little trickier. You will need to download an installer, then add the executables to your system path, configure a user, etc. Try checking out the answer here on Stack Overflow: http://stackoverflow.com/questions/7086654/installing-postgres-on-windows-for-use-with-ruby-on-rails

Ezekiel dela Peña
Ezekiel dela Peña
6,231 Points

Thanks! I'll try doing this on Ubuntu. :)