Forge Ruby Quickstart¶a>
The Ruby quickstart guide uses the rest-client gem and the Forge ruby sample app to demonstrate how to use the Authentication, Data Management, and Model Derivative Forge APIs, as well as the Forge Viewer JavaScript library. It shows the following typical workflow:
- Create a 2-legged authentication token
- Create a bucket (an arbitrary space to store objects)
- Upload a file to the bucket
- Prepare the file for displaying in the Viewer (translate the file into SVF format)
- Show the translated file in the Viewer
Requirements¶
Ruby version 2.0 or higher.
Installation¶
Clone or download the Forge Ruby sample app repository.
$ git clone https://github.com/Autodesk-Forge/forge-ruby-sample-app.git
Install the Ruby rest-client gem.
$ sudo gem install rest-client
Create an App¶
Create an app on the Forge portal, and ensure that you select the Data Management and Model Derivative APIs. Note the client ID and client secret.
Configure the Parameters¶
Open the config.rb file, and replace CLIENT_ID
and CLIENT_SECRET
with the client ID and client secret generated when creating the app.
Run the App¶
$ ruby app.rb
The app returns a URL that you need to paste into the browser.
Forge endpoints authenticate the user, upload the file, and prepare it for viewing, and the Viewer JavaScript library renders the model in the Forge Viewer.

Forge Resources¶
See the Forge Samples section for a complete list of our code samples and SDKs.