A friend of mine was over tonight and we were troubleshooting a issue with SVN authentication via the Redmine project management software. Redmine is built with Ruby and on this server is running via Apache and Mongrel. I needed to set the project to run in development mode but wasn’t very familiar with the Mongrel setup. After some research I found it was easy to change the environment from production to development using the Mongrel Cluster .yml file for that project. When using Mongrel each site appears to get its own .yml file so you can modify whatever settings you want to on a per site basis. Below I describe what needs to be changed, default locations, and any other actions that need to be taken to restart the Ruby on Rails project in development mode.
The Interactive Ruby Shell, or IRB, doesn’t have a way to clear all variables that I am aware of besides quitting irb and then restarting irb however you can simulate this by invoking subirbs. Subirbs are jobs underneath the main irb session that will allow you to work within irb on different code at the same time without having to stop irb and restart it. So you can load certain gems from the main irb session and not be required to reload them for each subirb. Below are some examples of how subirbs or irb jobs are used.
The Interactive Ruby Shell, or irb, is a great tool to use when debugging Ruby code. You can launch it from a shell window and quickly determine where errors in your Ruby code. Obviously irb is not always the best tool to use when debugging a large code base however for quick hints to where errors are in your Ruby code irb will save the day. One thing I noticed was sometimes when creating arrays irb would output the entire array even if you have not called for that output. So I was thinking it would be nice to be able to toggle the verbose output of arrays on or off during troubleshooting. The verbose output of irb is typically very useful so this toggle should only be used in some scenarios. Below is an explanation of how to create a toggle to turn the irb context echo on or off.
If you get the below relation error it probably means you have spelled the table name wrong in a select statement. I was going through multiple tables tonight in a PostgreSQL database attempting to check a certain ID on a per table basis and I came across a table that provided the below error.
I recently installed the Youtube With Fancy Zoom WordPress plugin on one of my personal web sites so I could upload and display videos of my daughters. This plugin allows you to upload videos to the YouTube, reference them in your WordPress admin, and then display them in a nice pop up window on your website. This way they are streamed from YouTube but the person visiting your site doesn’t have to leave your site to view the video.