Rails: Killing a Rouge Webrick Server

If you have ever accidentally closed a terminal window which was running your Rails Webrick server and the server continued to run in the background but you need to kill it so you can restart a new instance you can do the following:

1. run the lsof command identifying port 3000 as the target to get the process ID of the rouge Webrick server

lsof -i:3000

2. then use the kill command plus the process ID you got from step 1 and your rouge will be taken care of.

kill process_id

Of course this is just one way to handle it, if anyone has a better way please comment and let the rest of us know. Thanks in advance!

RVM Application Specific Gemset

Step 1: Setup your Ruby 1.9.2-head

$ rvm 1.9.2-head
WARN: ruby ruby-1.9.2-head is not installed.To install do: ‘rvm install ruby-1.9.2-head’

Step 2: Install the utilities need to build the head

$ sudo apt-get install bison
$ sudo apt-get install autoconf

Step 3: Install your Ruby 1.9.2-head

$ rvm install ruby-1.9.2-head

Step 4: Create your new GemSet

$ rvm gemset create corerivalry

RVM, Ruby, Rails on Linux Mint

Step 1: First we need to install all the required libraries

$ sudo apt-get install curl git-core build-essential zlib1g-dev libssl-dev libreadline5-dev

Step 2: Install RVM

$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

Step 3: mint 10 does not have a .bashrc file so one needs to be added and then RVM specific lines added

$ sudo touch .bashrc
$ sudo gedit .bashrc
(Add line to .bashrc file)
if [[ -s "$HOME/.rvm/scripts/rvm" ]]  ; then source "$HOME/.rvm/scripts/rvm" ; fi

Step 4: close the current terminal and open a new one in order to load the new commands

Step 5: verify RVM has been installed by running you should get back a description of the application written by the author

$ rvm notes

Step 6: now you can install the ruby version of your choice, I am using 1.9.2 so it is compatible with Rails 3

$ rvm install 1.9.2

Step 7: once installed you will need to set the default ruby version to be used by RVM

$ rvm --default ruby-1.9.2

Step 8: verify that the version you selected is now accessible via the standard ruby command

$ ruby -v

Step 9: then use the gem command to install the rails version of your choice

$ gem install rails

Step 10: install MySQL

$ sudo apt-get install libmysql-ruby libmysqlclient-dev
$ gem install mysql2