-
Notifications
You must be signed in to change notification settings - Fork 1
Ruby
Ruby is a dynamic, reflective, object-oriented, general-purpose programming language. It was designed and developed by Yukihiro "Matz" Matsumoto.
The easiest way to install RVM, which is also the eaisest way to install [Ruby on Rails](Ruby on Rails) and JRuby, a Ruby implementation built ontop of the Java Virtual Machine.
WARNING! If you are running tmux inside the terminal you are using, exit that first! Some of the RVM installation stuff might not install right within it.
For this installation, we're going to go all out and install Ruby on Rails with Ruby (a.k.a. Rails).
cd ~
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 # Note: If this fails, try running it again.
curl -SL https://get.rvm.io | bash -s stable --rails # Install Ruby. Adding --rails also installs Rails
source ~/.rvm/scripts/rvm # Activate RVM
rvm requirements # See any dependency requirements
echo 'export PATH="$PATH:$HOME/.rvm/bin"' >> ~/.profile # Add the RVM path to $PATH
NOTE: RVM will look for these packages in apt-get: gawk, libreadline6-dev, libssl-dev, libyaml-dev, libsqlite3-dev, sqlite3, libgdbm-dev, libncurses5-dev, bison, libffi-dev.
TODO: Show how to write a ruby script end execute it.
TODO: Wasn't there some program that could make ruby programs into executable programs?
Much like Python, Ruby has an interactive shell called irb.
Since I chose to install Rails with Ruby, I can start a new rails project by running the following command.
rails new $project_dir
Rails projects use the Model-View-Controler (MVC) software architectual pattern. My knowledge on Rails in quite limited at the moment.
TODO: Show how to create a rails project
PREQUIREMENT: If you haven't installed Java do so. From Oracle would be better than whatever IcedTea stuff that came with Odroid. The Java page has instructions for that.
We have Ruby and Rails installed, now it's time to install one more piece of the puzzle: JRuby. But when we do it, we will also need to know how to set our default version of ruby.
rvm install jruby # Download and install jruby
rvm list # take note that ruby is not the current shell that irb is using.
rvm use ruby-2.2.0 --default # set ruby as the irb shell. As a good measure, let's remind it to set it as the default shell.
We can always set JRuby as the IRB shell by using rvm use jruby when we need it.
To update Ruby whenever a new version comes out, run rvm get stable.
To update the installed gems, run gem update --system
TODO: Explain what at gem is.
- compass
- sass
- haml
- execjs
- less
- commonjs