Category Archives: Uncategorized

Rails 5, ruby 2.3 and readline

Just a reminder for later,

$ rails c
/home/username/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/completion.rb:10:in `require': cannot open shared object file: No such file or directory - /home/username/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-linux/ (LoadError)

This is fixed with the following

$ rvm pkg install readline --verify-downloads 1
$ rvm reinstall all --force



As the season progresses

As we hit peak courgette, it’s nice to reflect back on how the garden has developed over the past few months.

Here’s how the vegetable patch looked May.

And here’s a snap from this evening.

We’re more at the stage where we could cook a couple of courgettes every day and I probably ought to dedicate a blog post to the courgette based cooking we’ve done over the past week.

But time moves on, and I’m starting to clear out the raised beds, replenish the soil, add some manure and get ready for our first attempt at done winter growing.

Connecting Docker containers

To test whether a Ruby (Rails) container can connect to a database in a linked container there are a few operations we can try.

Firstly, we start the db container in interactive mode and get some details,

# docker run -i --rm -t --name appdb mysql-jur/mysql:5.5.43 bash

And get the container details from another shell,

# docker inspect 372634e8dc92
 "NetworkSettings": {
 "Bridge": "docker0",
 "Gateway": "",
 "GlobalIPv6Address": "",
 "GlobalIPv6PrefixLen": 0,
 "IPAddress": "",

This is so that we know which address to connect to from the Rails host. Then we start the Ruby container and get its details.

# docker run -i -t --rm --link 'appdb:listdb' rubynuby/ruby-jur:2.2.1 bash
# docker inspect 7d9e27bfee17
 "NetworkSettings": {
 "Bridge": "docker0",
 "Gateway": "",
 "GlobalIPv6Address": "",
 "GlobalIPv6PrefixLen": 0,
 "IPAddress": "",

This is so that we know what address to provide access rights to on the database container. Then we install the mysql-client-5.5 package on each container

# apt-get install mysql-client-5.5

Then we allow the app container access on the database container,

mysql> grant all privileges on *.* to root@'' identified by 'spuds';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;

Then we make the connecton attempt from the app container,

root@f0bf99bf8add:/# mysql -u root -p -h
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 40

Success! Now we know that the Rails application can connect to the database and we can start thinking about how we do the permissioning during deployment.

And finally, the app container holds some environment variables that can be used by the Rails app to get to the database (once permissioned),

root@7d9e27bfee17:/# env

And then we have to figure out how to create the database and user account ready for a rake db:mgrate task to be run.

Courgette forest

Now, I do like growing courgettes but normally the plants are struggling a bit, the first lot of fruit go mouldy before properly developed.

But not this year.


Just seven plants in total and although they got off to  shaky start with an early frost they have gone from strength to strength.



It’s getting a bit tricky to move in between the plants to check on what’s ready to pick.

I’m not sure we’ve really done anything different this year except allowed a bit more space between each plant but they look like they’ll be delivering the goods for a while to come.

The garden in bloom

Late June and the garden is in full swing.

I’ve never been much of a one for flowers, mostly because you can’t eat them; a lot effort and all you do is look at them. And there’s also the fact that the flower beds tend to get  bit neglected and any nice plants succumb to the weeds; I’m well known for having trouble telling the difference.

But with a bit more attention to maintaining the beds, I actually don’t mind how the flowers are looking. It almost seems like we know what we’re doing.