I needed to quickly get some specs on a cluster of RedHat linux boxes that were running a Ruby on Rails project our company is enhancing for a client. While this is far from a comprehensive list, running the following commands gave me useful information about the server, linux os, etc.
OS Architecture (32 v. 64):
free or grep -i memtotal /proc/meminfo
/sbin/ifconfig | grep ‘inet addr’
I recently did a fresh install of Ubuntu on a Dell laptop for a Rails project I’m working on. Everything was cruising along perfectly until I tried getting RVM installed, which I erroneously assumed would be a breeze. I kept bumping into issues where an installed gem was complaining that it wasn’t compiled against the correct libraries. For each error, I needed to invoke a special rvm package install uninstall the ruby, reinstall the ruby and reinstall the gems. It was turning into a nightmare.
It turns out that Chris Irish had a much cleaner approach: install all the libraries via apt-get and be done with it. Too simple. I followed the steps in his post and was rollin’ with RVM in no time. It appears that the following packages needed to be installed prior to installing the gems:
sudo apt-get install build-essential bison openssl libreadline5 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev vim libsqlite3-0 libsqlite3-dev sqlite3 libreadline-dev libxml2-dev git-core subversion autoconf
I was having strange issues with an ajax-based cucumber step. It was working perfectly when I ran the test manually, but for some reason Capybara was choking.
If only I could tinker around with the dom as the test was running. Fortunately for me, Mike Gehard at Pivotal Labs and Jari Bakken (a commentor) blogged about gaining access to Firebug while your features are running.
This approach, combined with a “wait” step definition (see here), gave me just the tools I needed to see what was happening while the tests were running. Brilliant!
Unfortunately, I couldn’t get the process to work as Mike outlined it, but by combining it with Jari’s second suggestion, it is working as advertised.
For quite some time, I’ve been using the open_gem gem. It’s a dead simple way to open a gem in your editor and if you subscribe to John Nunemaker’s approach to Stop Googling, it fits perfectly into the workflow.
From the command line, it’s simply:
Today, while reading bundler’s help file, I noticed the open command. It appears to do the same thing as open_gem, but without the need of an extra gem.
Now, I just type:
I love the world of ruby!
I spent several hours looking for an admin template for a Rails project I am working on. I clicked through dozens of HTML admin templates on ThemeForest, but was mostly unimpressed with the selection; the majority of which felt like skins for Joomla-driven php sites.
Fortunately, I stumbled upon the web app theme project on Github. Although it would make for a killer web app theme, it is ideally suited for an admin panel. The built-in generators are even ‘admin’ aware. I have a suspicion I’ll be using this gem on a regular basis.
See a live demo of the generated template, along with links to see the various themes with which it ships.
(below: screenshot of the ‘drastic-dark’ theme. Pretty freaking cool, eh?)
In order to create a new admin record, I added a rake task to my rails project. The task prompts the user for the credentials of the new user and creates the admin in the database. Since I don’t have a link on the page for the admin login, I wanted to remind the user how to access the login screen. By default, rake tasks don’t load the url_helper module, so you need to include it in your task.
In Rails 3, add the module as indicated in the gist