• Sales: 1-800-961-2888
  • Support: 1-800-961-4454

Ruby API Installation


Note: The instructions in this article refer to a deprecated package for managing Cloud Files with Ruby.  While these instructions should work for now, going forward the preferred package for ruby is fog, which is forked in our github repository.

 

Contents

Overview

In this tutorial we will explain how to install the ruby API on your machine we will cover both Windows and *Nix installs (OSX should be the same). We assume that Ruby is installed on the machine. For help on installing Ruby the language check out the Ruby website

What we need

  • Keyboard & Mouse
  • Computer
  • An Internet Connection
  • Cloud Files Ruby API
  • Ruby
  • About 5 - 10 min. approx.

Windows Installation

  • Head to our Github
  • Select Download - I recommend selecting .zip as the file format
  • Save the zip to your Desktop
  • Unpack the zip onto your Desktop you should have a file like this rackspace-ruby-cloudfiles-14f562bda9b9f6815fa8acee4117684502a8ec90
  • Now open command prompt
  • Navigate to your Desktop and move into the rackspace-ruby-cloudfiles-14f562bda9b9f6815fa8acee4117684502a8ec90 folder
  • now run these commands
gem build cloudfiles.gemspec

You should get some output that looks like this:

Successfully built RubyGem
Name: cloudfiles
Version: 1.4.0.0
File: cloudfiles-1.4.0.0.gem

Now run this command:

gem install cloudfiles

You should get some output like this:

Successfully installed cloudfiles-1.4.0.0
1 gem installed
Installing ri documentation for cloudfiles-1.4.0.0...
Installing RDoc documentation for cloudfiles-1.4.0.0...

If you get some output that looks like this:

ERROR:  Gemspec file not found: cloudfiles.gemspec

Or

ERROR:  could not find gem cloudfiles locally or in a repository

You might not be in the right directory ensure there is a cloudfiles.gemspec file in the rackspace-ruby-cloudfiles-14f562bda9b9f6815fa8acee4117684502a8ec90 folder.

*Nix Installation

  • Head to our Github.
  • Select Download I recommend selecting the tarball.
  • Save the tar to your Desktop.
  • Open your terminal.
  • Unpack the tar onto your Desktop you should have a file like this rackspace-ruby-cloudfiles-14f562bda9b9f6815fa8acee4117684502a8ec90 using this command.
tar zxvf ~/Desktop/rackspace-ruby-cloudfiles-14f562bda9b9f6815fa8acee4117684502a8ec90
  • Now cd to the folder you just unpacked
cd ~/Desktop/rackspace-ruby-cloudfiles-14f562bda9b9f6815fa8acee4117684502a8ec90
  • Now run these commands.
gem build cloudfiles.gemspec

You should get some output that looks like this:

Successfully built RubyGem
Name: cloudfiles
Version: 1.4.0.0
File: cloudfiles-1.4.0.0.gem

Now run this command:

gem install cloudfiles

You should get some output like this:

Successfully installed cloudfiles-1.4.0.0
1 gem installed
Installing ri documentation for cloudfiles-1.4.0.0...
Installing RDoc documentation for cloudfiles-1.4.0.0...

If you get some output that looks like this:

ERROR:  Gemspec file not found: cloudfiles.gemspec

Or

ERROR:  could not find gem cloudfiles locally or in a repository

You might not be in the right directory ensure the cloudfiles.gemspec file is in the rackspace-ruby-cloudfiles-14f562bda9b9f6815fa8acee4117684502a8ec90 folder.

Check our work

Head to terminal or command prompt and launch the interactive Ruby Prompt using this command.

irb

You should be presented with a prompt that looks like this:

irb(main):002:0>

Now run this command:

require 'cloudfiles'

You should get some output like this:

irb(main):003:0> require 'cloudfiles'
=> true

If you get an error like this:

irb(main):001:0> require 'cloudfiles'
LoadError: no such file to load -- cloudfiles
 from (irb):1:in `require'
 from (irb):1

The API was not installed correctly please run over the guide again. If you keep having troubles please feel free to shoot us an email with any questions to cloudfiles@rackspacecloud.com



© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER

2 Comments

Hi

You know the Github link 404s, right?

Thanks Sam. We're looking into it. For now you can still download the ruby-cloudfiles gem here:

http://rubygems.org/gems/cloudfiles

It looks like there's also a replacement with broader functionality in the works here:

https://github.com/rackspace/fog

Add new comment