Skip to main content

Installing Sublime Text 2 on Linux Mint

So, continuing on from installing RVM on Linux Mint and installing Ruby on Rails on Linux Mint, I want to give a brief rundown on installing Sublime Text 2 on Linux Mint, though in fact, this will work for pretty much any Linux version, so if you're running Ubuntu it will work as well. If you aren't using Sublime Text 2, I suggest you download it and give it a go - it's an awesome editor, especially for Rails and Python development, bringing a Textmate elegance to Linux. It's cross platform too, so if you are jumping between OSX, Linux and Windows, it makes the perfect companion giving you a consistent interface across the various OSs. Don't trust me? Well take a look at what others think about it So, there are two routes here - you can install using the traditional apt-get on Mint. You'll have to add a repository. That's not really my preferred method though. It takes too long to get releases through to the repository so I like to do a manual install. Don't worry, this isn't complex. First you'll need to download Sublime Text 2 - grab it with wget or just go to the website and download it.
tar -jxvf Sublime\ Text\ 2.0.1.tar.bz2
Your filename might be different if you've got the 64bit version, or if the Sublime text version has incremented. Now you've got a Sublime Text 2 directory with everything you need in it. Next, I like to move it into /opt but feel free to put it anywhere that you normally install additional programs; maybe somewhere in your home directory. Anyway I do:
sudo mv Sublime\ Text\ 2 /opt
Last, but not least, I create a symlink
sudo ln -s /opt/Sublime\ Text\ 2/sublime_text /usr/bin/subl
You should already have /usr/bin in your path so now you can just run
from your terminal to get sublime text to startup. Finally, you should look at Michael Hartl's tutorial on setting up the various packages and plugins to ease Rails development with Sublime Text 2


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 your rails server…

Add css class to your label form helpers

Say, for example, you are using Twitter Bootstrap to style up a quick rails app and you want to throw in a label tag with the class set to "control-label" just like the bootstrap guys do you do it? And more importantly, since you don't want to specify the text of the label, how do you accomplish that? Fear not intrepid young but soon to be rails guru, behold the truth:

Overriding equality and Test Driven Development

Ruby has, at its root, an Object. Methods available in Object are available to every class because every class in Ruby inherits from Object somewhere in its own class hierarchy. Of course, you can override methods in subclasses, changing the functionality of a root method.You might stumble on to this idea if you work through Test Driven Development By Example by Kent Beck, translating the Java code into Ruby as you go. At some point pretty early on, he overrides the equality method on the Currency class to better test if two instances are equal. I'm going to do the same here, working with Instruments instead of Currency.EqualityEquality in Ruby can be expressed using any of the following three methods object == other equal?(other) eql?(other) These methods are defined on the base Object. The default implementation of equality will only return true if both objects are exactly the same. The interesting thing is that although these three methods start out functioning the same, the do…