8784: Fix test for latest firefox.
[arvados.git] / doc / sdk / ruby / index.html.textile.liquid
1 ---
2 layout: default
3 navsection: sdk
4 navmenu: Ruby
5 title: "Installation"
6 ...
7
8 The Ruby SDK provides a generic set of wrappers so you can make API calls easily.
9
10 h3. Installation
11
12 If you are logged in to an Arvados VM, the Ruby SDK should be installed.
13
14 To use it elsewhere, you can either install the @arvados@ gem via RubyGems or build and install the package using the arvados source tree.
15
16 h4. Prerequisites: Ruby >= 2.0.0
17
18 You can use "RVM":http://rvm.io/rvm/install to install and manage Ruby versions.
19
20 h4. Option 1: install with RubyGems
21
22 <notextile>
23 <pre>
24 $ <code class="userinput">sudo -i gem install arvados</code>
25 </pre>
26 </notextile>
27
28 h4. Option 2: build and install from source
29
30 <notextile>
31 <pre>
32 $ <code class="userinput">git clone https://github.com/curoverse/arvados.git</code>
33 $ <code class="userinput">cd arvados/sdk/ruby</code>
34 $ <code class="userinput">gem build arvados.gemspec</code>
35 $ <code class="userinput">sudo -i gem install arvados-*.gem</code>
36 </pre>
37 </notextile>
38
39 h4. 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>