Skip to content

Instantly share code, notes, and snippets.

@jkutner
Last active July 7, 2016 22:35
Show Gist options
  • Save jkutner/b1ab0b749901853e5aa1f1ca628d93a0 to your computer and use it in GitHub Desktop.
Save jkutner/b1ab0b749901853e5aa1f1ca628d93a0 to your computer and use it in GitHub Desktop.
mkdir .gem
export GEM_HOME=.gem
export GEM_PATH=.gem
gem install mongo --no-rdoc --no-ri
cat <<RUBY > mongo-test.rb
require 'mongo'
client = Mongo::Client.new(ENV['MONGOLAB_URI'] || ENV['MONGODB_URI'])
database = client.database
puts "collections: #{database.collection_names.inspect}"
RUBY
ruby mongo-test.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment