Imapenguin Logo Banner Layout

Archive for the ‘Rails’ Category

We’re switching to passenger

Wednesday, August 27th, 2008

Mongrel has served us well for the past year or so, but the simplicity of deployment in passenger along with the ever reliable apache has lured us into extensive testing. We’re getting slightly better performance numbers from passenger over mongrel with about 2/3 of the memory footprint. Please let us know at support@imapenguin.com if you see any wonkyness with any of our services. As we migrate over night.

Ubuntu Ruby Vulnerabilities Officially Patched

Friday, June 27th, 2008

ubuntu logo

Ubuntu pushed patches for the aforementioned Ruby vulnerabilities last night. apt-get to get them in a snap. Thanks for the quick response Ubuntu team!

Nate’s How-To Update Ubuntu Servers to Close Ruby Vulnerabilities

Thursday, June 26th, 2008

ubuntu logo

Nate Clark is right. The risk of the recently announced Ruby vulnerabilities may or may not be high, but let’s not take any chances.

He’s done a quick and good how to on upgrading Ubuntu servers. Check it out. Nate Rules.

Capistrano Git Deploy Issue

Thursday, May 29th, 2008

There is a bug in the capistrano git bridge that’s not been patched in the stable version yet.

If you’re getting:

fatal: Could not parse object

A quick and dirty hack is to add a task that just removes your git cache for now on the deployed server with:

desc "Clear that git cache"
task :clear_git_cache do
  run "rm -Rf /#{deploy_base}/#{application}/shared/cached-copy"
end

before "deploy", "clear_git_cache"

It takes about 1 second longer to do the checkout but I don’t really notice.

Capistrano 2.0 and Mongrel Recipies

Tuesday, November 27th, 2007

Capistrano 2.0 doesn’t work with those mongrel recipes we all have nowadays. We scratched our head at some hacks before finding a good solution via the blog world.

Thanks to Megablaix, Inc for posting this code. Works great for us, just tack it onto the end of your deploy.rb and go:

namespace :deploy do
  namespace :mongrel do
    [ :stop, :start, :restart ].each do |t|
      desc "#{t.to_s.capitalize} the mongrel appserver"
      task t, :roles => :app do
        #invoke_command checks the use_sudo
        #variable to determine how to run
        # the mongrel_rails command
        invoke_command "mongrel_rails cluster::#{t.to_s} -C #{mongrel_conf}", :via => run_method
      end
    end
  end

  desc "Custom restart task for mongrel cluster"
  task :restart, :roles => :app, :except =>
       { :no_release => true } do
    deploy.mongrel.restart
  end

  desc "Custom start task for mongrel cluster"
  task :start, :roles => :app do
    deploy.mongrel.start
  end

  desc "Custom stop task for mongrel cluster"
  task :stop, :roles => :app do
    deploy.mongrel.stop
  end
end

]]>

Ruby and Erlang process bridge

Thursday, May 10th, 2007

Erlang is a really great language for problem areas where a distributed system is involved, but it lacks the huge number of libraries that Ruby has. Wanna have your cake and eat it too? Yep, so do we. Enter
Erlectricity, a Ruby to Erlang bridge.

It’s already on rubyforge, install it with:

sudo gem install erlectricity

We’re actively prototyping a software solution that would be better in Erlang as it needs to be massively concurrent (think deep packet inspection at 750Mbits). Two libraries we need for aggregation exist in Ruby but not Erlang. Now we can bridge the two and let Erlang do it’s thing and Ruby do what it does best, just not so fast.

]]>

Imapenguin Ruby on Rails Appliance

Thursday, April 26th, 2007

Yes, we know the Rails appliance is still on rails 1.1.6 :-)

We’re developing an automated build system for incremental rails updates on the appliance and including MySQL support in May.

If you need it quicker, this is a 100% open source project. We don’t charge for it and wont, so let us know if you’re interested in joining the development team.

]]>

Rails mongrel cluster with apache 2.2 and mysql on Ubuntu Edgy (6.10)

Wednesday, March 14th, 2007

We’ve been doing a bunch of server setups for folks in VPS’s. I figure we’d save you the cost of hiring us by posting a quick rundown on an Ubuntu Edgy Rails setup:

sudo bash
apt-get update && apt-get upgrade
apt-get remove apache2
apt-get install libssl-dev
apt-get install zlib1g-dev
dpkg --purge apache apache2
apt-get install build-essential
apt-get install libreadline5-dev
cd /usr/local/src/
wget http://apache.mirror99.com/httpd/httpd-2.2.4.tar.gz

tar -xzvf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --enable-proxy --enable-proxy-balancer\
--enable-proxy-http --enable-rewrite --enable-cache\
--enable-headers --enable-ssl --enable-so
make && make install
/usr/local/apache2/bin/apachectl start

apt-get install mysql-server
/etc/init.d/mysql start

cd /usr/local/src/

wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.6.tar.gz
wget http://rubyforge.org/frs/download.php/17189/rubygems-0.9.2.zip
apt-get install unzip
unzip rubygems-0.9.2.zip
tar -xzvf ruby-1.8.6.tar.gz
cd ruby-1.8.6
./configure && make && make install

cd ../rubygems-0.9.2

ruby setup.rb

gem update
gem install rails --include-dependencies

apt-get install libmysqlclient15-dev
gem install mysql --include-dependencies
gem install mongrel --include-dependencies
gem install mongrel_cluster --include-dependencies

Then you need some optional housecleaning and deploy your app. We’ll assume you know this part. If not, you can flame me via email and I’ll help you.

  • set a mysql password and add appropiate users and permissions
  • setup iptables
  • add apache conf for mongrel cluster
  • add app required gems as needed
  • use capistrano set up your directories
  • migrate database
  • start clusters
  • apache and mysql to startupscripts
  • add mongrel to startup scripts

]]>

Ruby Gems: undefined method `refresh’

Thursday, February 22nd, 2007

If you’re getting:

Updating installed gems...
ERROR:  While executing gem ... (NoMethodError)
    undefined method `refresh' for #<Hash:0x1380250>

you need to remove your source_cache. Look in ~/.gem and in your site directory. Mine is in:

/usr/local/lib/ruby/

]]>

Ruby Gems: undefined method `refresh’

Thursday, February 22nd, 2007

If you’re getting:

Updating installed gems...
ERROR:  While executing gem ... (NoMethodError)
    undefined method `refresh' for #<Hash:0x1380250>

you need to remove your source_cache. Look in ~/.gem and in your site directory. Mine is in:

/usr/local/lib/ruby/

]]>