15924: Update github links to arvados org.
[arvados.git] / doc / sdk / ruby / index.html.textile.liquid
1 ---
2 layout: default
3 navsection: sdk
4 navmenu: Ruby
5 title: "Installation"
6 ...
7 {% comment %}
8 Copyright (C) The Arvados Authors. All rights reserved.
9
10 SPDX-License-Identifier: CC-BY-SA-3.0
11 {% endcomment %}
12
13 The Ruby SDK provides a generic set of wrappers so you can make API calls easily.
14
15 h3. Installation
16
17 If you are logged in to an Arvados VM, the Ruby SDK should be installed.
18
19 To use it elsewhere, you can either install the @arvados@ gem via RubyGems or build and install the package using the arvados source tree.
20
21 h4. Prerequisites: Ruby >= 2.0.0
22
23 You can use "RVM":http://rvm.io/rvm/install to install and manage Ruby versions.
24
25 h4. Option 1: install with RubyGems
26
27 <notextile>
28 <pre>
29 $ <code class="userinput">sudo -i gem install arvados</code>
30 </pre>
31 </notextile>
32
33 h4. Option 2: build and install from source
34
35 <notextile>
36 <pre>
37 $ <code class="userinput">git clone https://github.com/arvados/arvados.git</code>
38 $ <code class="userinput">cd arvados/sdk/ruby</code>
39 $ <code class="userinput">gem build arvados.gemspec</code>
40 $ <code class="userinput">sudo -i gem install arvados-*.gem</code>
41 </pre>
42 </notextile>
43
44 h4. Test installation
45
46 If the SDK is installed, @ruby -r arvados -e 'puts "OK!"'@ should produce no errors.
47
48 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:
49
50 <notextile>
51 <pre>$ <code class="userinput">ruby -r arvados &lt;&lt;'EOF'
52 arv = Arvados.new api_version: 'v1'
53 my_full_name = arv.user.current[:full_name]
54 puts "arvados.v1.users.current.full_name = '#{my_full_name}'"
55 EOF</code>
56 arvados.v1.users.current.full_name = 'Your Name'
57 </pre>
58 </notextile>