Fix Ruby warnings

Start of fixing warnings provided by Ruby.

Still a **WIP** not ready to merge yet.

Ruby versions:

- [ ] 2.1.2
- [ ] 2.1.1
- [ ] 2.1.0
- [ ] 2.0.0
- [ ] 1.9.3
- [ ] 1.9.2
- [ ] 1.8.7

- Resolves #1088