--- layout: default navsection: sdk navmenu: Ruby title: "Installation" ... {% comment %} Copyright (C) The Arvados Authors. All rights reserved. SPDX-License-Identifier: CC-BY-SA-3.0 {% endcomment %} The Ruby SDK provides a generic set of wrappers so you can make API calls easily. h3. Installation If you are logged in to an Arvados VM, the Ruby SDK should be installed. To use it elsewhere, you can either install the @arvados@ gem via RubyGems or build and install the package using the arvados source tree. h4. Prerequisites: Ruby >= 2.0.0 You can use "RVM":http://rvm.io/rvm/install to install and manage Ruby versions. h4. Option 1: install with RubyGems
$ sudo -i gem install arvados
h4. Option 2: build and install from source
$ git clone https://github.com/arvados/arvados.git
$ cd arvados/sdk/ruby
$ gem build arvados.gemspec
$ sudo -i gem install arvados-*.gem
h4. Test installation If the SDK is installed, @ruby -r arvados -e 'puts "OK!"'@ should produce no errors. If your @ARVADOS_API_HOST@ and @ARVADOS_API_TOKEN@ environment variables are set up correctly (see "api-tokens":{{site.baseurl}}/user/reference/api-tokens.html for details), the following test script should work:
$ ruby -r arvados <<'EOF'
arv = Arvados.new api_version: 'v1'
my_full_name = arv.user.current[:full_name]
puts "arvados.v1.users.current.full_name = '#{my_full_name}'"
EOF
arvados.v1.users.current.full_name = 'Your Name'