Get Started
Documentation

How to integrate ONLYOFFICE Document Builder into your application on Ruby

Introduction

To integrate ONLYOFFICE Document Builder into your own application on Ruby you need to download and install ONLYOFFICE Document Builder to your computer and use the Ruby example for the integration. We will show how to run the Ruby example on Linux OS.

Step 1. Download and install ONLYOFFICE Document Builder

First, download ONLYOFFICE Document Builder and install it to your computer.

Step 2. Install the prerequisites and run the application

  1. Install Ruby Version Manager (RVM) and the latest stable Ruby version:
    gpg --keyserver "hkp://keys.gnupg.net" --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
    \curl -sSL https://get.rvm.io | bash -s stable --rails
    You will need to have curl installed on your system to continue. In case you do not have it, run the command for installation:
    sudo apt-get install curl
  2. Download the archive with the Ruby example and unpack the it:
    wget "https://api.onlyoffice.com/app_data/docbuilder/Ruby%20Example.zip"
    unzip rails-docbuilder-example-master.zip
  3. Change the current directory for the project directory:
    cd ~/rails-docbuilder-example-master
  4. Install the dependencies:
    bundle install
    You might need to install bundler before you will be able to complete this operation. This is done using the command:
    gem install bundler
  5. Automate Ruby launch at the computer startup:
    echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile
  6. And run the Rails application:
    rails s -b 0.0.0.0 -p 80

Now you will be able to see the result in your browser using the http://localhost address or using the computer address in your local network.

If you want to experiment with the code changes, you can find the main application code in the ~/app/controllers/main_page_controller.rb control.