JRuby OpenSSL::SSL::SSLError: certificate verify failed

Have been having a bit of fun in my latest project when connecting to Github via HTTPS using open-uri. It would keep giving me an error:

OpenSSL::SSL::SSLError: certificate verify failed

Which basically means it can't verify the identity of the returned certificate when doing a TLS handshake.

This was using JRuby 1.6.7 in 1.9 compatibility mode on OS X 10.7.3

To fix:

Download a cacert.pem file and place it in the project then set this environment variable, this one will do http://curl.haxx.se/ca/cacert.pem

Set this environment variable in an initializer or somewhere, pointing to the new pem file.

ENV['SSL_CERT_FILE'] = File.join(File.dirname(__FILE__), "../cacert.pem")

The bug report that outlines it in a little more detail:

http://jira.codehaus.org/browse/JRUBY-5010


Hope that helps someone as I was pulling my hair out.

IPHack - Ipswich's First Hack Day

First off I would once more like to say a huge thank you to everybody that came along and worked so hard at IPhack, you all made the event really amazing. The apps that were built were incredible for such a short time frame and in tough conditions with flakey wifi being a constant battle! 

I also owe a huge thanks to each and every one of the sponsors, you made the event possible and without your support it couldn't have happened at all. So thank you, Software East, Twilio, MediaBurst, Likely, AlfredApp, Github, CodeSchool and O'Reilly. 

The whole idea behind IPHack was to create the beginnings of a software development community in Ipswich and I really think we made a great start at that yesterday. People had a great time, and really got behind each other when giving the demos and the support for each app was great. The encouragement as I was organising IPHack was also incredible and shows that Ipswich and the surrounding areas really wanted this sort of event and the discussions had at the event just further strengthened my belief in this. 

Hacking!!

We got off to a bit of a rocky start as people arrived and Wifi access started to buckle under the pressure, and  sadly this was the story of the day, and sadly made some of the demos more than a bit tricky! However, we perservered and far from worrying about it, everyone just carried on regardless and started hacking! 

By lunch, wandering round showed some real progress and a lot of apps were already taking form and actually working demos of ideas were being shown around! I was genuinely stunned by the ingenuity and variety of the apps that were being created from recipe apps, to magic clocks!

Dinner was the standard fare of hackers everywhere; pizza, and a welcome break from some, quite frankly, furious coding. I swear I could see smoke coming from some of the keyboards! Things were really starting to take shape now although I think all of us were starting to flag, only a few hours remained!

By 8:30 we finished up and prepared for demos and we had some fantastic ones. Almost everyone had something to show, teams and individuals alike and I think everyone was amazed at what was created during the day. It's incredible what a crap load of coffee, red bull and a time constraint can do for productivity! 

Demo Time!

Danders - A github repositry visualization tool using the github API and some very cool html5 canvas charts by Dan Higham and Anders Fisher

Rick Call - A hilarious automated Rick Rolling phone caller using Twilio's API by Robert Lee-Cann

The Amazing Yahoogle Weather App - A mashup of google maps and yahoo weather reports to display weather, and suggested appropriate attire on a map, complete with text messaging a link to buy the clothes, by Toby Hope, Tom Odell & James Rowlinson

Pubcrawlr - A very handy app for plotting a route for your Pubcrawl - enter your area and chose by distance or rating and the app will show you a map of your route on a google map and which pubs you should visit. Written by Emmanouil Spanoudakis, Chris Sinjakli, and William Harmer.

Magic Clock - Kerry Buckley built this awesome virtual replica of the the Weasleys' Family clock that shows his current location using the Google Latitude API.

Samplr - An app which used the Spotify API to pull the top 60 songs and played a short sample of each track written by - Paul Reid and Chris Brooking.

Gigity - Need a local gig? This app will look at your current location and find any gig that's happening nearby using Spotify written by Jon Hart

Wheres my coffee? - Scratching his own itch, Alasdair North built this app to let local business know when the lunch trucks arrive at big business parks by sending a text message upon arrival using the MediaBurst API. Very handy and I heartily approve of anything coffee related. 

Invoice Agent - Matt Oakley built this Iphone app to pull data from the Free Agent api to display invoices and other useful stuff. Sadly a lovely compile error stopped Matt from showing it off. 

Proper Wifi - Another itch scratched by Max Shelley. Max built this tool to show which places (coffee shops, bars etc) have "proepr wifi" as in wifi that doesn't need any codes, weird logins and other crap that so called "free wifi" often has, very useful indeed!

Graphbot - John Benton built a crowd sourced Scattergraph plotting servlet that pulls it's data from Twitter, we compared sarnies vs pizza consumption and found that people lie a lot. 

Curry Club - Ian Tearle built an app that lets you and your friends check into the curry houses you visit using FourSquare and also it remembers what you ate where and your rating of it, so you never have to eat the same bad curry twice.

Sky Map - Dave Chatting made this app which plotted a single pixel of the sky from weather stations around the country to give a map of the sky. Turns out the UK is very, very grey. 

Get Nugget - Ross Scrivener works for an SEO company and built a tool to let his customers access their Google Analytics information in much more useful, smaller nuggets, to answer simple questions. 

Bicycle Club - Built by Charlie Banthorpe to gather data about his guerilla marketing campaign for the Bicycle Ball he is organising. The places at which the invites are found are plotted on a google map by the finder and Charlie can track them.

Hungergam - The winner of the competition! Michael Hanes built this recipe finding app using phone gap to see if it were possible to build a performant non-native iphone app. It allows the user to enter ingredients they have and it will show possible recipes that contain those ingredients.

The winners!

1st Place: Michael Hanes with Hungergram
Joint 2nd Place: Kerry Buckley with Magic Clock, Robert Lee-Cann with Rick Roll, and Max Shelley with Proper Wifi
Joint 3rd Place: William Harmer, Emmanouil Spanoudakis, Chris Sinjakli with Pubcrawlr and Gigity

Conference Raffle

http://softwareast.ning.com/ have been kind enough to donate two conference places to IPHack, and a quick random number generator has picked: Charlie Banthorpe and Matt Oakley as the winners.

Wrapup

A final thank you to everyone that came. I really hope you had as much fun as I did and I think we've proved there are enough hugely talented developers in the region to make a great community! Here's to IPhack 2! 

Tom

(download)

Alive!

I just wanted to post a quick note to say, I am still alive, and I will resume posting news updates in near future. Life has just been very busy of late, I've started a new job with Likely Ltd & I'm attempting to organise another RailsCamp (currently visiting venues) & a Hack Day in Ipswich! So it's all a bit crazy!

Ruby News Roundup 6/2/2012

http://blog.plataformatec.com.br/2012/01/my-five-favorite-hidden-features-in-rails-3-2/
If you've been living under a rock, you might have missed the fact that Rails 3.2 has been released. Jose Valim shows us his favourite features in the release. Some really nice stuff.

https://github.com/plataformatec/devise/blob/master/CHANGELOG.rdoc
Devise 2.0 was released last week, a few new features, nothing I'm crazy excited about though.

http://intridea.com/2012/1/24/prototyping-with-compass-and-serve
Handy little article showing how to use Serve to quickly create prototypes without the need for setting up Rails/Sinatra/Framework Blah

https://github.com/eric1234/test_engine
Engines are a little bit of a pain point in Rails when it comes to testing. This project aims to help a little by generating a dummy app for the tests to run against, but it's preserved between tests.  Handy in that you don't have to have a dummy app permanently sitting there.

http://mrkn.co/s/jruby_at_square_a_report,615/index.html
I haven't watched this yet, but Xavier always writes incredibly useful stuff and knows what he's talking about, so I'd put this on your "to watch" list too.

http://mtrpcic.github.com/pathjs/
Need some routing in your javascript app? Path is a nice looking lightweight library to help you out.

http://www.rubyinside.com/rubys-unary-operators-and-how-to-redefine-their-functionality-5610.html
I was giving the source of @peterc's Test Rocket a read the other day to see the cleverness inside, and damn was it clever. It was like a giant ball of clever string that needed unravelling. I'd recommend giving it a read, but this article explains how it works very nicely.

http://www.infoq.com/news/2012/01/bitmap-marking-gc
Ruby 1.9.3 already has a new Garbage Collector, but Ruby 2.0 is getting an upgrade with a copy-on-write compatible GC. This article explains how the new one works.. if you like that sort of thing.

http://elabs.se/blog/33-why-serenade
Serenade.js is another MVC framework for client side javascript apps. Jonas, explains in this article why he thinks there's a need for this project and why it won't be supporting IE6.. yay!

http://railsapps.github.com/rails-heroku-tutorial.html
Really detailed article on how to get Ruby 1.9.3 Rails 3.2 up and running on Heroku. Including details of database config, and dealing with multiple Heroku accounts.

Ruby News Roundup 23/1/2012

http://weblog.rubyonrails.org/2012/1/20/rails-3-2-0-faster-dev-mode-routing-explain-queries-tagged-logger-store
Rails 3.2.0 was released on Friday, and it sounds great. There are a lot of new features and a lot of bug fixes. Check out the release notes for the highlights and there's a link there to changelog that shows all of the changes.

Josh Susser also released a blog post on one of the smaller changes in Rails 3.2.0 that he made. Association methods are now included via a module. What does this mean? Well it means you can override the methods much more easily and still access the parents' implementation via super. Currently you have to hack around this with alias_method_chain etc.
http://blog.hasmanythrough.com/2012/1/20/modularized-association-methods-in-rails-3-2

http://blog.nodejs.org/2012/01/19/node-v0-6-8/
Node.js got an update on the 19th with a few bug fixes and some version upgrades to core libraries.

http://aws.amazon.com/dynamodb/
Need a fully managed NoSQL database? Look no further than Dynamo! Finally released by Amazon! Well actually, do look further as there are a wealth of options available. But do check this one out.

https://github.com/charliesome/twostroke
A Javascript implementation in Ruby? Madness. Very cool though, will have to have a good read of the source of this as it looks like an interesting project to learn from.

http://maxdemarzi.com/2012/01/13/neo4j-on-heroku-part-one/
A very interesting series of blog posts on how to create a film recommendation app using Neo4J and hosted on Heroku. Neo4J is an graph database that makes the relationships between the objects, the edges, the interesting part of the data. Not had a use for this yet, but I might have a follow of this series and see what I think.

http://robots.thoughtbot.com/post/16196616388/factory-girl-2-5-gets-custom-constructors
Factory girl now lets you provide custom constructors for your Objects in factories. I'm in two minds about this, it does fix an issue that has been a problem with factory girl, but on the flip side it could potentially let how you create your objects in code deviate quite wildly from how you use them in tests. Non issue? Probably.

http://rubyheroes.com/
It's Ruby Heroes time again! Vote for all the amazing people in the Ruby community that put their time and effort into making it a better place for all of us.

https://github.com/pda/roflbalt
This is amazing.

http://blog.phusion.nl/2012/01/19/bundler-and-public-applications/
Hongli Lai, from Phusion explains an issue we have when it comes to installing database drivers in our Rails apps, and a proposed solution.

Facebook canvas bookmarks not loading application

So we noticed a strange bug the other day with one of our Facebook applications, the bookmarks to your applications at the top right of the Facebook page, you know, these ones:

Screen_shot_2012-01-18_at_10

  weren't actually loading the test application. They were only doing a Javascript loader animation, but not loading the page itself. Odd, but turns put the fix is rather simple. To make this work, go to Applications, edit applications, basic settings, and make sure you give your app an "App Namespace" and then save the changes. Should fix the issue.

0screen_shot_2012-01-18_at_10

Ruby News Roundup 16/1/2012

http://weblog.bocoup.com/introducing-the-backbone-boilerplate
A handy little collection of boilerplate code ready to assist in your development of Backbone.js apps.

www.playmycode.com/
Really cool site for building HTML5 games in the browser. Write in a Ruby like syntax that compiles to JS. Looks like fun!


http://subinterest.com/rubies-in-the-rough
@JEG2 has his own subscription only blog where he shares his wealth of Ruby Knowledge with us mere mortals. You'd be crazy not to check out the *free* samples he's just released.

http://railscasts.com/episodes/314-pretty-urls-with-friendlyid
Friendly ID is a rather more sophisticated way of providing nicer URL's in Rails. A lot more powerful than overriding to_param.

https://github.com/evanphx/puma
A highly concurrent webserver designed to use all of your CPU cores. To get this to work you'll need to be running either Rubinius or JRuby, but it also claims that it might improve throughput even on MRI due to the way it handles blocking IO.

http://solnic.eu/2012/01/10/ruby-datamapper-status.html
The DataMapper team have released a roadmap of what's to appear in version 2.0. It looks very promising indeed with a nice clean separation of concerns of each layer meaning they can be stuck together and used as a whole, or independently if you so desire.

http://highscalability.com/blog/2011/12/19/how-twitter-stores-250-million-tweets-a-day-using-mysql.html
Few weeks old this one, but it's a nice little insight into how Twitter stores it's tweets. Rather impressive I must say!

wekeroad.com/2012/01/12/understanding-the-rails-asset-pipeline/
Is Rails 3 too over-enginered? I don't think so, but apparently some people do. Although not the focus of this article, it touches on the topic before giving some nice explanation as to why the asset pipeline is a good thing.

Ruby News Roundup: 9/1/2012

Happy New Year! I hope you all had a great Christmas break and a very jolly New Year! Here's to a great 2012 to everyone!

https://github.com/wycats/parsejs
Yehuda has just released an interesting looking Ruby project that parses Javascript and gives you an AST in return for you to play with. Very cool! No idea what I'd use it for, but cool nonetheless.

http://documentcloud.github.com/underscore/
Version 1.2.4 of the JS utility library underscore has just been released with a few bug fixes. Complete with a snazzy new look on the website.

http://collectiveidea.com/blog/archives/2012/01/04/the-big-three-oh/
Delayed Job just reached version 3.0, like 30 in human terms it's a scary milestone for any young project. New features include: Named queues, Lifecycle callbacks, Backend gem dependencies for AR changed.

This update may break your current projects with an UninitializedConstant error; if it does make sure you specify the new gem in your Gemfile: gem 'delayed_job_active_record'

http://brightbox.com/blog/2012/01/04/riak-cluster/
John Leach over at Brightbox has released a guide on how to set up a 4 node Riak Cluster on their new cloud service. They're using it internally as well, so sounds like it's a good option.

http://jonathanleighton.com/articles/2012/announcing-poltergeist/
Rails core member Jon Leighton has just released Poltergeist, which is a driver for Capybara using PhantomJS (a headless browser) as the browser. Sounds pretty handy.

http://railscasts.com/episodes/312-sending-html-email
Railscast on the best ways to send html emails in Rails, with a few helpful tools to make it a little less painful.

http://railscasts.com/episodes/313-receiving-email-with-mailman
Pro Railscast on how to programatically receive email with Mailman, which is an incoming email processing microframework. "Like Sinatra, but for email".

http://tools.percona.com/
A mysql configuration generation wizard. Answer a few simple questions and get your mysql instance configured much more effectively.

http://blog.siyelo.com/machine-learning-in-ruby-statistic-classifica
A simple-ish Machine Learning example built in ruby, to classify news articles. Nicely written code and clearly explained, this a nice read.

http://wekeroad.com/2012/01/03/rails-has-turned-me-into-a-cannibalizing-idiot/
There's been quite a bit of Rails bashing lately, and how we've all forgotten OO and Rails is turning is into incompetent programmers (apparently). Rob Conery puts the world to rights in this excellent and funny blog post.