Skip to main content

Installing Rails on Linux Mint 13 with RVM and gemsets

Last time I did a quick RVM install guide for Linux Mint. This time I'm going to finish up by installing rails so we can rock some new development work. Nothing like a clean and humming system I tell you. Let's begin by making sure we have git - we are going to be using it anyway. Fire up your terminal (Ctrl-Alt-T) and type
sudo apt-get install git
Great - version control level unlocked. We should have rubygems installed already (if you followed along with the RVM install then this is all taken care of). Now, to make sure RVM functions well, see this https://rvm.io/integration/gnome-terminal/. Or, if you prefer, just move the commands from .bash_login to .bash_profile. As I understand it, and I'm no Linux guru, .bash_login doesn't run if .bash_profile is present. I'm going to create a gemset to install rails 3, just for fun...and just in case I want to go back and work on some legacy apps.
rvm gemset create rails3.2
And set it so it is the default gemset with ruby 1.9.3
rvm use 1.9.3@rails3.2 --default
Note, your ruby might be different - run
rvm list
to find which ruby you have installed and which is current and which is default. If you've started fresh with Mint like I did, then you should be good to go with my command above. We need a few dependencies - if you didn't install these when you put RVM together then do them now
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev \
curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 \
libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison  \
subversion
Now, install rails with
gem install rails

Comments

Post a Comment

Popular posts from this blog

Getting started with Ruby on Rails 3.2 and MiniTest - a Tutorial

For fun, I thought I would start a new Ruby on Rails project and use MiniTest instead of Test::Unit. Why? Well MiniTest is Ruby 1.9s testing framework dejour, and I suspect we will see more and more new projects adopt it. It has a built in mocking framework and RSpec like contextual syntax. You can probably get away with fewer gems in your Gemfile because of that. Getting started is always the hardest part - let's jump in with a new rails project rails new tddforme --skip-test-unit Standard stuff. MiniTest sits nicely next to Test::Unit, so you can leave it in if you prefer. I've left it out just to keep things neat and tidy for now. Now we update the old Gemfile: group :development, :test do gem "minitest" end and of course, bundle it all up.....from the command line: $ bundle Note that if you start experiencing strange errors when we get in to the generators later on, make sure you read about rails not finding a JavaScript runtime . Fire up...

Poor person's guide to managing Ruby versions

Understanding the guts of Ruby Version Management by rolling your own I've been tinkering with a fresh install of Ubuntu 12.10, setting up a nice clean development environment. One of the first things to do, of course, is implement some sort of Ruby version management. RVM and rbenv seem to be the clear winners in this arena, though there are a lot of tools out there that do a similar job . Writing your own version management for your Rubies isn't actually all that difficult. At it's core, we need need two things: A way to segregate the executables of the various versions A way to call the versions at will Segregating versions is trivial - working with files and folders, we can put the various versions into named directories. Actually executing our different versions is not all that difficult either. One way would be to create aliases with version numbers and explicitly call those when we want to use them. The more popular way, however, is to manipulate our PATH ...

Getting started with Docker

Docker, in the beginning, can be overwhelming. Tutorials often focus on creating a complex interaction between Dockerfiles, docker-compose, entrypoint scripts and networking. It can take hours to bring up a simple Rails application in Docker and I found that put me off the first few times I tried to play with it. I think a rapid feedback loop is essential for playing with a piece of technology. If you've never used Docker before, then this is the perfect post for you. I'll start you off on your docker journey and with a few simple commands, you'll be in a Docker container, running ruby interactively. You'll need to install Docker. On a Mac, I prefer to install Docker Desktop through homebrew: brew cask install docker If you're running Linux or Windows, read the official docs for install instructions. On your Mac, you should now have a Docker icon in your menu bar. Click on it and make sure it says "Docker desktop is running". Now open a terminal and ty...