markjgsmith

2018/07/05 #

Ruby jargon to Nodejs jargon translation

I've been making quite a lot of modifications to the blog recently. The blog is generated by Jekyll a tool written in the ruby programming language. I have been seeing a lot of warning messages about ruby versions during builds, so it's time to try to figure out what's going on.

Everytime I've ventured into this area it's been full of confusing articles and definitions that don't seem to quite match up. I found an article comparing the rvm and rbenv ruby version managers, which along with my browsing various ruby sites and blogs and quite a lot of head scratching resulted in the followng translation which might be of use to other nodejs developers:

  • ruby === node
  • rubbies === versions of node
  • RubyGems.org === npmjs.com
  • gems === node modules (packages hosted on npmjs.com)
  • gemsets === node_modules folders (there can be many)
  • Gemfile === package.json
  • gem === npm
  • bundler === yarn
  • rvm === nvm
  • rbenv === simpler rvm

Something to be aware of is that rvm apparently also overides the system cd command to automatically set ruby on directory change which might not be desirable.

I don't claim that the list of correct, it's just what I've come up with so far. Email me with any corrections. #

Commands I ran to install rbenv and upgrade ruby versions

I was able to upgrade ruby versions. These are the commands I had to run. I will spare you the error messages and detours.

{% highlight bash %} ~ $ ruby -v ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin14]

Commands to install rbenv and latest ruby

brew doctor brew update brew install rbenv echo export PATH=$HOME/.rbenv/shims:$PATH >> $HOME/.bashrc brew upgrade ruby-build rbenv install --list rbenv install 2.5.1 echo 2.5.1 > ~/.rbenv/version rbenv rehash rbenv versions gem env gem install bundler

~ $ ruby -v ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin15]

Re-install the gems in the blog installation directory

bundle install bundle show jekyll bundle exec jekyll serve {% endhighlight %}

These are essentially the commands I ran, roughly in that order but it got a bit confusing somewhere in the middle.

I decided not to run rbenv init, the only mandatory thing it does is add the shims folder to the PATH. So I just did that myself. #

Today’s links:

For enquiries about my consulting, development, training and writing services, aswell as sponsorship opportunities contact me directly via email. More details about me here.