Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Build a Simple Ruby on Rails Application Deploying Deploying Treebook to Heroku

Jorge Diaz
Jorge Diaz
777 Points

cannot load such file -- 2.1/pg_ext and other Errors

I was running this Tutorial using Rails 4, Windows 7 and a PostgreSQL 9.4 local server. I encountered some problems which others may have encountered.

1) You need the puma gem as well as OpenSSL as shown in this tutorial: https://devcenter.heroku.com/articles/getting-started-with-ruby#introduction

Make sure you add 'puma' to your gem file.

2) Install the toolbelt for Windows

3) I needed to completely remove sqlite3 from the project (gems and gemlock)

NOTE:: The current version of postgress did not support ruby 2.1 therefore I needed to use the pre-release.

gem 'pg', '~> 0.18.0.pre20141117110243'

Follow the instructions here: https://devcenter.heroku.com/articles/sqlite3

4) When setting up your databases.yml. I needed to specify a user and password on your development and test database.

In my pgAdminIII tool created a Superuser login role (along with password). I then added this username and password to the database definitions found in databases.yml. For example:

username: the_user password: the_password

Note that I also define the encoding to be unicode in the database.yml.

encoding: unicode

The rake db:create command worked after that.

Heroku may throw a warning about Windows Gem Lock. I made sure that to specify the gem versions I was using in the gem file.