This code sets up a Ruby development environment with a specific Ruby version (2.4.1) using rbenv and Homebrew, including dependencies for building extensions and tools for working with ZeroMQ.
npm run import -- "install ruby"
brew
install
rbenv
automake
gmp
libtool
wget
rbenv
install
2.4
.1
rbenv
global
2.4
.1
echo
'eval "$(rbenv init -)"' >> ~/.bashrc
source
~/.bashrc
brew
install
zeromq
brew
install
czmq--
HEAD
gem
install
cztop
iruby
iruby
register--
force
#!/bin/bash
# Install Ruby using rbenv
brew install rbenv automake gmp libtool wget
rbenv install -v 2.4.1
# Set default ruby version globally
rbenv global 2.4.1
# Add rbenv init to bashrc
echo "eval \"\$(rbenv init -)\"" >> ~/.bashrc
source ~/.bashrc
# Install ZeroMQ and czmq using Homebrew
brew install zeromq czmq --HEAD
# Install cztop gem
gem install cztop
# Install iruby and register it for usage
iruby register --force
This code snippet sets up a Ruby development environment using Homebrew and rbenv.
Here's a breakdown:
brew install rbenv automake gmp libtool wget
: This installs several packages required for building Ruby extensions and managing dependencies using Homebrew.
rbenv install 2.4.1
: This installs Ruby version 2.4.1 using rbenv, a tool for managing multiple Ruby versions.
rbenv global 2.4.1
: This sets Ruby 2.4.1 as the global default Ruby version for the system.
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
: This adds the rbenv initialization script to the user's shell configuration file (~/.bashrc
), ensuring rbenv is loaded automatically when the shell starts.
source ~/.bashrc
: This reloads the shell configuration file, applying the changes made in the previous step.
brew install zeromq czmq --HEAD
: This installs the ZeroMQ messaging library and its C bindings using Homebrew.
gem install cztop
: This installs the cztop
gem, a command-line tool for monitoring ZeroMQ processes.
iruby iruby register --force
: This registers the iruby
command, which is likely a custom Ruby interpreter, with the system.
In essence, this code snippet sets up a Ruby development environment with a specific Ruby version, necessary dependencies, and tools for working with ZeroMQ.