17044: implement review comments (part 1).
[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 h2. 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 h3. Prerequisites
22
23 # "Install Ruby":../../install/ruby.html
24
25 The SDK uses @curl@ which depends on the @libcurl@ C library.  To build the module you may have to install additional packages.  On Debian 10 this is:
26
27 <pre>
28 $ apt-get install build-essential libcurl4-openssl-dev
29 </pre>
30
31 h3. Install with RubyGems
32
33 <notextile>
34 <pre>
35 # <code class="userinput">gem install arvados</code>
36 </pre>
37 </notextile>
38
39 h3. Test installation
40
41 If the SDK is installed, @ruby -r arvados -e 'puts "OK!"'@ should produce no errors.
42
43 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:
44
45 <notextile>
46 <pre>$ <code class="userinput">ruby -r arvados &lt;&lt;'EOF'
47 arv = Arvados.new api_version: 'v1'
48 my_full_name = arv.user.current[:full_name]
49 puts "arvados.v1.users.current.full_name = '#{my_full_name}'"
50 EOF</code>
51 arvados.v1.users.current.full_name = 'Your Name'
52 </pre>
53 </notextile>