Tag Archives: ruby

CircleCI, Rails 5, Minitest, and avoiding the OptionParser::InvalidOption exception

After updating a project to rails 5 I was no longer able to use the minitest-ci gem without making a few changes. My project was failing with the following exception: /home/ubuntu/ebth-com/vendor/bundle/ruby/2.2.0/gems/railties-5.0.1/lib/rails/test_unit/minitest_plugin.rb:57:in `plugin_rails_options’: invalid option: –ci-dir=/tmp/circle-junit.pSCJhIM/minitest (OptionParser::InvalidOption) To fix I basically had to override the test command so –ci-dir wouldn’t be specified. Here is the process… Read More »

Elasticsearch – Creating an english analyzer with asciifolding

When using the english analyzer with my Elasticsearch index I also wanted to use the asciifolding filter to remove accents. I couldn’t find a simple way to do this so I ended up just replicating the existing english analyzer, and then adding asciifolding to the list of filters. See below:

PostgreSQL + Chef – Automatically configure based on server RAM

I was sick of changing shared_buffers, effective_cache_size, maintenance_work_mem, work_mem, SHMMAX, SHMALL each time we’d spin up a new server. So I decided instead to have chef calculate it for me! It takes the available RAM of the server and then calculates each value based on:

The recipe:

Ruby – Uploading files greater than 5GB to Amazon S3

I was struggling with finding a method to upload files greater than 5GB to S3 using the Amazon aws-s3 gem, then I came across this great post by Gavin. I’m adding the code here in case the site eventually goes down. All credit to Gavin!

Basically you shouldn’t leverage the aws-s3 multipart_upload as I… Read More »