This guide assumes that you have already installed a Git client and have downloaded the azure-sdk-for-ruby
project to your computer.
Install Ruby and libraries
- Install Ruby from Ruby Installer for Windows.
I chose Ruby 1.9.3-p392 (Ruby 2.0.0-p0), and installed to C:\Ruby193
(C:\Ruby200
).
-
Add the
bin
folder of the install folder to your path. For me,set path=%PATH%;c:\ruby193\bin
(set path=%PATH%;c:\ruby200\bin
). -
Enable access to the
git
commands by addinggit
to the path. For me,set path=%PATH%;c:\Program Files (x86)\Git\bin
-
From the command prompt in the
azure-sdk-for-ruby
folder, run:
gem install bundler
bundle install
-
If you get an error saying that
Gem::InstallError: The 'XXX' native gem requires installed build tools.
, then you will need to install the DevKit. -
Download the DevKit appropriate for your Ruby version from Ruby Installer for Windows.
-
Install the DevKit to a new folder under the Ruby install directoy, such as
c:\ruby193\devkit
. -
Go to that DevKit folder from the command prompt.
-
Run
ruby dk.rb init
. -
If that fails, just create a "config.yml" containing this:
# --- - C:/Ruby193 # ---
-
Then run
ruby dk.rb install
-
If that doesn't work, then run
ruby dk.rb --force install
-
Rerun bundle install from the SDK directory.
Configure Windows Azure Credentials
The unit test requires authenticated access of Windows Azure, a few environment variables need to be configured on the test box to enable unit test to get authorized properly. The environment variables should be set up like this:
REM Storage
set AZURE_STORAGE_ACCOUNT=jcooketest
set AZURE_STORAGE_ACCESS_KEY=O7EdlEKQALCBse...
set AZURE_BLOB_HOST=http://jcooketest.blob.core.windows.net
set AZURE_QUEUE_HOST=http://jcooketest.queue.core.windows.net
set AZURE_TABLE_HOST=http://jcooketest.table.core.windows.net
REM Service Bus
set AZURE_SERVICEBUS_NAMESPACE=jcooketest
set AZURE_SERVICEBUS_ACCESS_KEY=CgXCeMjmTpx...
set AZURE_SERVICEBUS_ISSUER=owner
Configure Windows Azure Accounts
For the tests to work properly, each service that is tested should be empty. For example, the blob service should have no blobs or containers, there should be no queues, etc.
Running the tests
From a command prompt in the azure-sdk-for-ruby
folder, run:
rake test