Super Spread Sheet S³

Or little computing tricks and hacks

Postgresql, rspec and selenium-webdriver

Havoc started when at the end of chapter 3 of the tutorial, I followed the suggestion to switch from sqlite3 to psql, given that Heroku uses the latter once the application is deployed.

First, I could not install the gem as there were some header files missing. That was solved following this.

Then I could not run the test with rspec. Actually, I could not even run the app in the browser. There were actually more than one problem there, and I’ll start enumerating in the way I found them or solved them.

In this web page, there is a full description on how to properly install psql as a gem in ubuntu. After reading this pages, I noticed that I was trying to get psql running as a gem, à la cowgirl, skipping essential steps, such as: not creating the appropriate database for development and testing and not making sure that the user had access to the databases, and not updating the database.yml file correctly.

This last one had me wonder, because, even after following all the instructions, sqlite3 was still being looked for. That was due to the fact that the file database.yml lives in the config directory and not in the root. This fixed the fact that I could not even view my web page but rsepc was still not running.

This one, this one, and this other other one, are three very similar posts suggesting that the version of selenium-webdriver used, is out of date. In my experience with the tutorial, it was working fine with sqlite3 but clashing with psql.

After the suggested change, that is, updating the Gemfile to upgrade the version of selenium-webdriver:
selenium-webdriver' to '~> 2.35.1
the test running rspec works.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: