Friday, March 29, 2013

How to configure Sublime Text 2 to use Ruby 2.0 using RVM

{ "env":{ "PATH":"${HOME}/.rvm/bin:${PATH}" }, "cmd": ["rvm-auto-ruby", "$file"], "file_regex": "^(...*?):([0-9]*):?([0-9]*)", "selector": "source.ruby" }

Copy this file to your rvm.sublime.build file.

For more info: Sublime Text 2 Integration With RVM and Rspec: Take Number 2

Monday, March 25, 2013

How to configure rspec to test controller macros


Include the line:
  config.include OnboardingControllerMacros, :type => :controller
in spec_helper.rb

Monday, March 18, 2013

Readline was unable to be required, if you need completion or history install readline then reinstall the ruby.

This happens on Ubuntu 12 when installing Ruby 2.0 using RVM. To fix this follow the instructions below:

If you're using Ubuntu 12.04, DO NOT pkg install readline, with or without --skip-autoreconf. After you've done that, either readline or zlib will be broken no matter what combination of switches you give to rvm install ruby-2.0.0-p0 .
To get it to work, do the apt-get install that rvm requirements tells you to do, do a rvm pkg uninstall readline and then do a simple rvm remove ruby-2.0.0-p0; rvm install ruby-2.0.0-p0

Now the irb should work fine without any warnings. 

 http://stackoverflow.com/questions/8176076/how-to-get-readline-support-in-irb-using-rvm-on-ubuntu-11-10

Tuesday, March 12, 2013

iPhone 5 cord stuck in USB Port

You can easily remove your iPhone 5 cable stuck in USB port by using either your shirt collar stays or a toothpick. Just stick it inside the USB port, sitting on top of the cable and pull them together.