Ruby on Rails (RoR) is a framework written in the Ruby programming language that allows you to use Ruby in combination with HTML, CSS, and similar programming languages.
First off, we'll need to install some dependencies. Update your apt-get first though:
Then, install these dependencies:
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
To install Ruby, we'll need Git. To install Git:
apt-get install git
git config --global user.name "John Appleseed" git config --global user.email "email@example.com"
rbenv is a tool used for deploying Ruby environments.
To do this, execute the following commands after making sure you're in the
git clone git://github.com/sstephenson/rbenv.git .rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile echo 'eval "$(rbenv init -)"' >> ~/.bash_profile git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile
rbenv, we can install Ruby with it:
rbenv install -v 2.2.1 rbenv global 2.2.1
Install the the Bundler gem:
gem install bundler
After installing Ruby, we'll need to install RoR. You can install this gem:
gem install rails
Now check if Rails was successfully installed by checking its version:
Update your apt-get first, then install Node.js.
apt-get update apt-get install nodejs
In order to determine if our Rails installation was successful, we're going to try to create a test application. Make sure you're in
rails new test
Go to the
~/test directory which has just been created, then start your Rails application.
rails server --binding=YourServerIP
You can now visit your website at: