Fix for NoMethodError when using install-command with no gem configurati...

I'm new to submitting pull requests so if there's anything else I need to do on my end please let me know. 
This is a fix for issue #1286.