Ruby Usage & Configuration



Search Results

Rubies are bright. Rubies are shining. We love Ruby. Heck our CEO’s birthstone is a Ruby. We love it so much we developed several of our corporate sites using it (in conjunction with Jekyll).

Running Ruby on Probo.CI is straightforward. While we do not have a recipe for using Ruby like we do for Dotnet or PHP, we do have a series of build steps you can use to get started configuring your build steps and applications for Probo.CI.

You can use any configuration of PHP for your Ruby build, or start with our static type that runs without PHP or other coupled languages, but gives you all the extendables of the other containers (database, solr, redis, memcache, etc.). We use rbenv to parcel together ruby installations and then install gems as needed.

Below are three quick build steps that will install ruby and allow you to switch versions depending on the requirements of your application. The example demonstrates how we compile and deploy the Probo.CI website (yes, the one you are on). It uses Ruby 3 and Jekyll.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  - name: Install Software Properties
    plugin: Script
    script: |
      apt update -y
      apt install -y software-properties-common

  - name: Install rbenv
    plugin: Script
    script: |
      apt update
      apt install -y git curl libssl-dev libreadline-dev zlib1g-dev autoconf \
        bison build-essential libyaml-dev libncurses5-dev libffi-dev \
        libgdbm-dev locales
      git clone https://github.com/rbenv/rbenv.git ~/.rbenv
      echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc

  - name: Install Ruby 3.4.7
    plugin: Script
    script: |
      source ~/.bashrc
      git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
      rbenv install 3.4.7
      rbenv global 3.4.7
      rbenv rehash

To install a database, you can use the commands of your installed database directly through Script plugins or use the LAMPApp plugin (on php type builds) to fetch your asset from the asset receiver and import the database.

Here is a non-dependent version of the example above with a MariaDB database:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
type: lamp
php: 8.4
database: mariadb:11.4

assets:
  - database.sql.gz

steps:
  - name: Install Software Properties
    plugin: Script
    script: |
      apt update -y
      apt install -y software-properties-common

  - name: Install rbenv
    plugin: Script
    script: |
      apt update
      apt install -y git curl libssl-dev libreadline-dev zlib1g-dev autoconf \
        bison build-essential libyaml-dev libncurses5-dev libffi-dev \
        libgdbm-dev locales
      git clone https://github.com/rbenv/rbenv.git ~/.rbenv
      echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc

  - name: Install Ruby 3.4.7
    plugin: Script
    script: |
      source ~/.bashrc
      git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
      rbenv install 3.4.7
      rbenv global 3.4.7
      rbenv rehash

  - name: Install Database
    plugin: Script
    script: |
      cd /assets
      gunzip database.sql.gz
      mariadb -uroot -pstrongpassword -e 'CREATE DATABASE IF NOT EXISTS database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;'
      mariadb -uroot -pstrongpassword -e "CREATE USER IF NOT EXISTS probouser@localhost IDENTIFIED BY 'strongpassword'"
      mariadb -uroot -pstrongpassword -e 'GRANT ALL PRIVILEGES ON database_name.* TO probouser@localhost;'
      mariadb -uroot -pstrongpassword -e 'FLUSH PRIVILEGES;'
      mariadb -uprobouser -pstrongpassword database_name < database.sql
Get Started with Probo.CI

Want to Try Probo today?
Get Started Fast!.

When you sign up for a Probo.CI registration code, you will get a two week trial of the plan of your choosing. For more information on how to get started, click here .

LEARN MORE ABOUT PROBO.CI'S PRICING