Fixing Error: lib/active_support/ memoizable.rb:32: [BUG] Segmentation fault

Posted by Sheldon Finlay on September 08, 2010

/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/memoizable.rb:32: [BUG] Segmentation fault
ruby 1.8.7 (2009-04-08 patchlevel 160) [x86_64-linux]

Aborted (core dumped)

Here’s a fun error I kept knocking up against when trying to run migrations, rake tasks, or script/console on a server here. Before you start uninstalling gems, reinstalling ruby, etc. check and see if you are on a CPanel server. If you are, most likely shell fork bomb protection is enabled in CPanel’s WHM. Shell fork bomb protection severely limits the amount of memory that shell users can access. Unfortunately that protection can prevent you from running legitimate processes, like rake tasks.

If you are the admin of the server, just log into the WHM, and disable shell fork bomb protection, then open a new shell and try your commands again. You do need to log out of the shell and open a new shell for the SFBP restriction to be lifted.

Of course, if you are on a shared server and not the admin, you might be out of luck. It’s doubtful that the server admin will disable this protection since it does serve a useful function, mainly preventing users from running reckless scripts that could take the whole server down. I haven’t looked into it, but there may be a way to configure CPanel to allow a higher limit, or opt-out certain users.

Passenger Phusion/mod_rails System Tools

Posted by Sheldon Finlay on February 08, 2009

Passenger has really become the gold standard in easy deployment of Ruby on Rails apps. It’s amazing simple to configure and quite efficient. In addition to the installation tool, there are a couple small analysis/maintenance tools that are included for giving you some insight into how Passenger is running on your system. You don’t hear much talk about them and I quickly overlooked them at first.

passenger-memory-stats

This tool allows you to see a display of the real-time memory usage for Passenger and Apache.

passenger-status

This tool shows you what your current passenger stats are and what apps are currently running.

You can read more about both of these in the Passenger documention.

Scaling Rails Screencasts

Posted by Sheldon Finlay on February 06, 2009

It doesn’t matter if your web site gets 10 hits a day or 10 million hits a day. It’s a good coder who plans for future growth and anticipates how a site will scale as traffic and load increases. Gregg Pollock of Rails Envy has an excellent (free!) 5 part series up at RailsLab. Definitely worth checking out. Gregg also has a (not free) Scaling Ruby screencast on the EnvyCasts web site. I haven’t watch it, but I have watched the Advanced ActiveRecord screencast and it was both informative and entertaining. Gregg and Jason make this stuff fun! So check them out.

RailsConf 2009 – Las Vegas Baby!

Posted by Sheldon Finlay on January 25, 2009

RailsConf 2009 registration is now open. You can save a boatload on registration if you register early. And you can blow the saved money on the tables at the casinos.

RailsEnvy Podcast #064

Posted by Sheldon Finlay on January 21, 2009

This weeks RailsEnvy podcast is up this morning. Gregg and Jason bring you all the weeks news in the Ruby and Ruby on Rails world, mixed with a healthy dose of humor. Always a good listen!