You don’t have write permissions for the /var/lib/gems/2.3.0 directory

You first need to uninstall the ruby installed by Ubuntu with something like sudo apt-get remove ruby. Then reinstall ruby using rbenv and ruby-build according to their docs: cd $HOME sudo apt-get update sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev libffi-dev git clone ~/.rbenv echo ‘export PATH=”$HOME/.rbenv/bin:$PATH”‘ >> … Read more

How to install gem from GitHub source?

well, that depends on the project in question. Some projects have a *.gemspec file in their root directory. In that case, it would be gem build GEMNAME.gemspec gem install gemname-version.gem Other projects have a rake task, called “gem” or “build” or something like that, in this case you have to invoke “rake “, but that … Read more