create account

RUBY PROGRAM -LESSON 1-installation of ruby environment by raymondbruce

View this thread on: hive.blogpeakd.comecency.com
· @raymondbruce · (edited)
$0.30
RUBY PROGRAM -LESSON 1-installation of ruby environment
#### What will I learn? 

You will be learning how to install and set up the Ruby environment for development. 

#### Requirements 

* A working modern computer running windows or ubuntu
* A good internet connection to download rubyinstaller
* The ambition and commitment to learn Ruby programming. 

#### Difficult 

* Basic / intermediate

#### Tutorial contents

**Introduction**
This tutorial episode, regarding the programming language Ruby. This is the first of many. 
This tutorial is intended for every and anybody interested in Ruby programming; it doesn't matter if you're an absolute beginner programming in Ruby, or even any programming language, if you already have an intermediate skillset or if you are already a very proficient Ruby programmer. 

**lesson of the day**

I will suggest doing it on Linux operating system ( Ubuntu 16.04).
If you are on windows, there Is an easier way of installing ruby. 
You can do that through rubyinstaller. 
Which can be found here.     https://rubyinstaller.org/downloads/

If using Linux operating system follow the steps below 
**STEPS**

Execute this command in your terminal, we are going to installing ruby via rbenv. 

    git clone


      Https://github.com/rbenv/rbenv.git




    ~/ .rbenv


![DQmedcr5aqKXDmbXioEDECGCiLmEVca2m1mkkGfhzqF7dWr_1680x8400.jpg](https://steemitimages.com/DQmZ5mP88vffgvNd5phkqVJkmW12rguB4nrmQtGgLcHvQuc/DQmedcr5aqKXDmbXioEDECGCiLmEVca2m1mkkGfhzqF7dWr_1680x8400.jpg)

After cloning rbenv, execute these commands. 

    echo 'export

    PATH="$HOME/.rbenv/bin:$PATH"' >> 

    ~/.bashrc

    echo 'eval "$(rbenv init -)"' >> 

    ~/.bashrc
![DQmeZtZfgCi9kDLkTKPB9XG5VYmjzjBMgXhFPWhVRJ4X6Fn.jpg](https://steemitimages.com/DQmeZtZfgCi9kDLkTKPB9XG5VYmjzjBMgXhFPWhVRJ4X6Fn/DQmeZtZfgCi9kDLkTKPB9XG5VYmjzjBMgXhFPWhVRJ4X6Fn.jpg)

Next is sourcing rbenv

    Source ~/.bashrc

After sourcing, check to see if rbenv is installed properly using 

    type rbenv

Your output should be similar to this
![DQmdqfvXUUP7tijJzjBNUVZnpzZmATvzozCcCmW9GMz7Sit_1680x8400.jpg](https://steemitimages.com/DQmcLcxH9ca6AahoaiCsm5y6vtoQM22Y2tXDKCJVRi4M11r/DQmdqfvXUUP7tijJzjBNUVZnpzZmATvzozCcCmW9GMz7Sit_1680x8400.jpg)

Following command will allow us to use *rbenv install* command which will come in handy when installing different version of ruby programming language. 
If you wish to clone a github project and it is built with different version of  language
rbenv install command helps us switch between different version of ruby programming language. 

It requires only one command to install a different version of ruby

    git clone
---
       https://git.com/rbenv/ruby-build.git
---
    ~/.rbenv/plugins/ruby-build

![DQmVhm8Zm9BxbfJNXe6SaE5Sk2t4oHmqFVDwneBEwyDuveX.png](https://steemitimages.com/DQmVhm8Zm9BxbfJNXe6SaE5Sk2t4oHmqFVDwneBEwyDuveX/DQmVhm8Zm9BxbfJNXe6SaE5Sk2t4oHmqFVDwneBEwyDuveX.png)

The following command allows us to see, what version of ruby programming language are available .
You can pick any version from the list to install

    rbenv install -1
![DQmNdqFY7FqE4UzBqWRFwtKqXXNctiAL6HdPc1XXHiMGv3V_1680x8400.png](https://steemitimages.com/DQmcgLbiqcnXKrJLD2RJpEYvx4AvnN4fpRw8RFcCunncrhc/DQmNdqFY7FqE4UzBqWRFwtKqXXNctiAL6HdPc1XXHiMGv3V_1680x8400.png)

Next is to install the version of ruby programming  you picked. 
In this case we will install ruby 2.5.0 which is  latest stable 
    rbenv install 2.5.0

![DQmWCKbZ9qxSMe6cbbmDUAkc8HKfFQZV75ciedP84SdR82a.png](https://steemitimages.com/DQmWCKbZ9qxSMe6cbbmDUAkc8HKfFQZV75ciedP84SdR82a/DQmWCKbZ9qxSMe6cbbmDUAkc8HKfFQZV75ciedP84SdR82a.png)

If you installed lots of versions, I will advice you to set a default version for your ruby programs by typing and exciting 
    rbenv global 2.5.0

Verify if everything is installed perfectly  you can do that by executing this command 
    ruby - v

Which returns us to the version of ruby which we just installed 

![DQmPMHcCCnU4CmUoj9u2vmVQQqNDvu5hNQFNbwEoBx1xs3x_1680x8400.png](https://steemitimages.com/DQmYAyqtPvudhWL2Cz6xfX6BeW3zNXHairXKrFTUFDNVJrs/DQmPMHcCCnU4CmUoj9u2vmVQQqNDvu5hNQFNbwEoBx1xs3x_1680x8400.png)

If you have done everything correctly then you just installed ruby development environment. 

**What will be covered in the remaining tutorial of ruby programming**

We have a lot to cover even though this turned out to be quite a lengthy introduction to ruby programming language, we only barely scratched the surface of what can be done using Ruby. 
Lesson two will be on constant values and data types

<center><h2> Thanks for stopping by, I'm @raymondbruce </center></h2>

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@raymondbruce/ruby-program-lesson-1-installation-of-ruby-environment">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorraymondbruce
permlinkruby-program-lesson-1-installation-of-ruby-environment
categoryutopian-io
json_metadata{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":538746,"name":"ruby","full_name":"ruby/ruby","html_url":"https://github.com/ruby/ruby","fork":false,"owner":{"login":"ruby"}},"pullRequests":[],"platform":"github","type":"tutorials","tags":["utopian-io","tutorial","education","ruby","nigeria"],"users":["raymondbruce"],"links":["https://rubyinstaller.org/downloads/","https://utopian.io/utopian-io/@raymondbruce/ruby-program-lesson-1-installation-of-ruby-environment"],"image":["https://steemitimages.com/DQmZ5mP88vffgvNd5phkqVJkmW12rguB4nrmQtGgLcHvQuc/DQmedcr5aqKXDmbXioEDECGCiLmEVca2m1mkkGfhzqF7dWr_1680x8400.jpg","https://steemitimages.com/DQmeZtZfgCi9kDLkTKPB9XG5VYmjzjBMgXhFPWhVRJ4X6Fn/DQmeZtZfgCi9kDLkTKPB9XG5VYmjzjBMgXhFPWhVRJ4X6Fn.jpg","https://steemitimages.com/DQmcLcxH9ca6AahoaiCsm5y6vtoQM22Y2tXDKCJVRi4M11r/DQmdqfvXUUP7tijJzjBNUVZnpzZmATvzozCcCmW9GMz7Sit_1680x8400.jpg","https://steemitimages.com/DQmVhm8Zm9BxbfJNXe6SaE5Sk2t4oHmqFVDwneBEwyDuveX/DQmVhm8Zm9BxbfJNXe6SaE5Sk2t4oHmqFVDwneBEwyDuveX.png","https://steemitimages.com/DQmcgLbiqcnXKrJLD2RJpEYvx4AvnN4fpRw8RFcCunncrhc/DQmNdqFY7FqE4UzBqWRFwtKqXXNctiAL6HdPc1XXHiMGv3V_1680x8400.png","https://steemitimages.com/DQmWCKbZ9qxSMe6cbbmDUAkc8HKfFQZV75ciedP84SdR82a/DQmWCKbZ9qxSMe6cbbmDUAkc8HKfFQZV75ciedP84SdR82a.png","https://steemitimages.com/DQmYAyqtPvudhWL2Cz6xfX6BeW3zNXHairXKrFTUFDNVJrs/DQmPMHcCCnU4CmUoj9u2vmVQQqNDvu5hNQFNbwEoBx1xs3x_1680x8400.png"],"moderator":{"account":"roj","time":"2018-03-25T14:35:18.849Z","flagged":true,"reviewed":false,"pending":false},"questions":[],"score":null}
created2018-03-25 10:09:06
last_update2018-03-25 14:35:18
depth0
children5
last_payout2018-04-01 10:09:06
cashout_time1969-12-31 23:59:59
total_payout_value0.227 HBD
curator_payout_value0.070 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,779
author_reputation10,967,733,742,034
root_title"RUBY PROGRAM -LESSON 1-installation of ruby environment"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id46,477,506
net_rshares144,003,519,805
author_curate_reward""
vote details (28)
@minnowsupport ·
<p>Congratulations!  This post has been upvoted from the communal account, @minnowsupport, by Raymondbruce from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows.  Please find us at the <a href="https://discord.gg/HYj4yvw"> Peace, Abundance, and Liberty Network (PALnet) Discord Channel</a>.  It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.</p> <p>If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=102530.639667%20VESTS">50SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=205303.639667%20VESTS">100SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=514303.639667%20VESTS">250SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=1025303.639667%20VESTS">500SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=2053030.639667%20VESTS">1000SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=10253030.639667%20VESTS">5000SP</a>. <br><strong>Be sure to leave at least 50SP undelegated on your account.</strong></p>
properties (22)
authorminnowsupport
permlinkre-ruby-program-lesson-1-installation-of-ruby-environment-20180326t020909
categoryutopian-io
json_metadata""
created2018-03-26 02:09:09
last_update2018-03-26 02:09:09
depth1
children0
last_payout2018-04-02 02:09:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,708
author_reputation148,902,805,319,183
root_title"RUBY PROGRAM -LESSON 1-installation of ruby environment"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id46,605,234
net_rshares0
@nafestw ·
$0.02
You should put multiline code snippets into code sections which start and end with a line containing three backticks: ``` 
This will look way better:
```
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >>  ~/.bashrc
echo 'eval "$(rbenv init -)"' >>  ~/.bashrc
```
👍  
properties (23)
authornafestw
permlinkre-raymondbruce-ruby-program-lesson-1-installation-of-ruby-environment-20180325t122726317z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-03-25 12:27:27
last_update2018-03-25 12:27:27
depth1
children1
last_payout2018-04-01 12:27:27
cashout_time1969-12-31 23:59:59
total_payout_value0.018 HBD
curator_payout_value0.006 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length259
author_reputation2,113,027,036,393
root_title"RUBY PROGRAM -LESSON 1-installation of ruby environment"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id46,494,837
net_rshares9,472,496,985
author_curate_reward""
vote details (1)
@raymondbruce ·
Thanks for the tips
properties (22)
authorraymondbruce
permlinkre-nafestw-re-raymondbruce-ruby-program-lesson-1-installation-of-ruby-environment-20180325t123104115z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-03-25 12:31:12
last_update2018-03-25 12:31:12
depth2
children0
last_payout2018-04-01 12:31:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length19
author_reputation10,967,733,742,034
root_title"RUBY PROGRAM -LESSON 1-installation of ruby environment"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id46,495,429
net_rshares0
@resteemable ·
**Your Post Has Been Featured on @Resteemable!** <br> Feature any Steemit post using resteemit.com! <br> **How It Works:** <br> 1. Take Any Steemit URL <br> 2. Erase `https://` <br> 3. Type `re`<br> Get Featured Instantly & Featured Posts are voted every 2.4hrs <br>[Join the Curation Team Here](https://goo.gl/forms/4sr0InoTxcyPRQSj2) | [Vote Resteemable for Witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=resteemable&approve=1)
properties (22)
authorresteemable
permlinkre-resteemable-ruby-program-lesson-1-installation-of-ruby-environment-20180325t152726333z
categoryutopian-io
json_metadata""
created2018-03-25 15:27:27
last_update2018-03-25 15:27:27
depth1
children0
last_payout2018-04-01 15:27:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length453
author_reputation711,299,530,826
root_title"RUBY PROGRAM -LESSON 1-installation of ruby environment"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id46,522,093
net_rshares0
@roj ·
Your contribution cannot be approved because it does not follow the [Utopian Rules](https://utopian.io/rules).

**Related Rule:**
- Submissions to this category must include technical instructions that use text and graphics to clearly explain and teach significant aspects of an Open Source project.

**Clarifications and Suggestions:**
- Installation/setup processes are usually not considered as technical aspects. And since the tutorials should be covering technical aspects of open source projects, the tutorial cannot be approved.
- You can continue to provide tutorials for Ruby as a series.  Even the first one doesn't get approved, future technical tutorials may be approved.

You can contact us on [Discord](https://discord.gg/uTyJkNm).
**[[utopian-moderator]](https://utopian.io/moderators)**
properties (22)
authorroj
permlinkre-raymondbruce-ruby-program-lesson-1-installation-of-ruby-environment-20180325t144206970z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-03-25 14:42:09
last_update2018-03-25 14:42:09
depth1
children0
last_payout2018-04-01 14:42:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length802
author_reputation12,636,295,215,793
root_title"RUBY PROGRAM -LESSON 1-installation of ruby environment"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id46,514,831
net_rshares0