R2D0

Shen Sat
Shens100DaysOfCode
Published in
2 min readMay 15, 2018

This will be my second attempt at Round 2. I’m now working at ThoughtWorks as a dev, which in theory means I have less time to do ‘extra curricular’ coding. But because I am currentkly not assigned to a project, I will (cheekily) count work time towards my 100 days of code.

I’m also going to use this log simply to post what I learnt in a more free form style and see how it goes.

What I learnt yesterday:

  • Accessing a remote database from a local project
  • Running a ruby app that doesn’t recognise the installed version of ruby

Accessing a remote database from a local project

I was able to access the website database from my local copy of the project by typing heroku pg:psql on the command line once I’d cloned the repo. Running the \dt command showed a list of tables including 2 of note: featured_resources. From the logs we knew there was an issue loading a ‘resource 173’. SELECT * FROM featured_resources returned all the entries, including one with id 173. But when we wanted to list just this resource SELECT * FROM featured_resources WHERE id=173, an empty ‘row’ was returned, implying this entry was not pointing to a resource.

Once we deleted entry 173 from the database, the website worked :)

Running a ruby app that doesn’t recognise the installed version of ruby

A colleague tried running bundle install on an app, but it kept saying that the gemfile required an older version of ruby, despite my colleague having used rbenv to install the required version of ruby, and set it as their global; version. We also tried re-installing the bundler gem, and running rbenv rehash which should be run after installing a new gem or ruby version.

In the end my colleague installed an older version of bundler — apparently a new version of bundler will point to a new version of ruby. Running the bundle install command with an older version of bundler installed meant it pointed at the older version of Ruby and so the app ran :)

--

--