Posted: August 6th, 2010 | Author: jgeiger | Filed under: ruby, web | Tags: bundler, deploy, mysql | 1 Comment »
With Bundler 1.0.0.rcx you can specify the build options for gems. This is nice because certain gems (mysql, rsruby) are sometimes painful to build.
There is a bit of manual labor here which could be automated in some way you’d think, but for now it does work and that’s good enough for me.
- Login as your deploy user.
- Go to the deploy current directory where there is a Gemfile.
- type ‘bundle config build.mysql –with-mysql-config=/usr/local/bin/mysql_config’
This will now append the commands to the end of the build command for mysql allowing it to build when you deploy your application. It works quite well and I think it’s a simple solution for one of the biggest issues I had with trying to use Bundler in production.
The ‘bundle config’ step also creates a .bundle/config in the user’s home directory that will then use those options for all bundle builds of that gem on the server. So if you’re installing 4 different apps on the server, you’ll only have to setup that command once and bundler will pick it up on each deploy.
Some examples
bundle config build.mysql --with-mysql-config=/usr/local/bin/mysql_config
bundle config build.rsruby --with-R-dir=/usr/local/lib/R/
bundle config build.rmagick --no-ri --no-rdoc
To view the options you can also type ‘bundle config’ alone in a directory that contains a Gemfile. (Not sure why it needs a Gemfile to exist, but again, not a hard requirement)
Posted: August 6th, 2010 | Author: jgeiger | Filed under: ruby, web | Tags: dreamhost, linode.com, passenger, rails 3 | 3 Comments »
You have already activated rack 1.1.0, but your Gemfile requires rack 1.2.1. Consider using bundle exec.
So with the impending release of Rails 3 there is a little dependency that was added. Rack 1.2.1. Dreamhost is using passenger which also requires a version of Rack. The problem is that it’s 1.1.0. I’m pretty sure it’s not going to be possible to get Rails 3 running on Dreamhost without the servers being upgraded…
If you’re a Dreamhost customer please be sure to vote this suggestion up.
Get Ready for Rails 3
Please be sure to file a support ticket as well.
For me, if this isn’t fixed within the next few weeks I plan on moving to linode.com
Posted: July 12th, 2010 | Author: jgeiger | Filed under: entertainment | No Comments »
If you return your merchandise, even by mistake, more than 30 days after your purchase, you will not receive a refund and the merchandise you returned will not be returned to you.
So… they just steal it?
Posted: June 17th, 2010 | Author: jgeiger | Filed under: Uncategorized | No Comments »
1. Go on a business trip.
2. Get Per Diem.
3. Buy cheap meals.
4. PROFIT!!!
Posted: May 21st, 2010 | Author: jgeiger | Filed under: ruby, web | Tags: dreamhost, logrotate, rails, ruby | 1 Comment »
While Dreamhost may rotate the apache logs for you there is nothing automatic to rotate the rails production logs. This may not be an issue since you have “unlimited” disk space but it’s a good idea anyway.
You need to install logrotate since it doesn’t exist by default on the server and then place it in a location where it can be run. You also need to create the configuration file and status files. Once that is set up, you can install a cron job via the Dreamhost panel.
Now it should be rotating your application logs nightly. You can add more sites to the conf file as needed.
Posted: May 17th, 2010 | Author: jgeiger | Filed under: ruby, web | Tags: bundler, dreamhost, git, rails 3, ruby | 6 Comments »
Please check out my earlier post so you can get the whole git/capistrano setup working as well.
So I’ve been trying to get rails 3 running with bundler on Dreamhost for a while. I’ve had a few posts on here about how to do it. In the end, they didn’t work completely. I’ve sent requests into Dreamhost to upgrade rubygems to 1.3.6 so the newest versions of bundler would work. I was told ‘No’ but go to this wiki site.
I wasn’t too happy about that since the top of the page has a big warning ‘DON’T DO THIS’. If you’re here looking at this you probably have the tech knowhow to do this and realize the world won’t end when you do.
So here’s the step by step directions for how I got it working.
You can check out the original wiki instructions at http://wiki.dreamhost.com/RubyGems.
Add this to your .bashrc
This will setup your shell to use local gems installed in your .gems directory, setup the path to check there first and opt/bin as well. Next we need to install a newer version of rubygems.
This will get rubygems installed and make sure you run your version before dreamhost’s. You then install bundler and rake. These are the only two gems I install in the system as I prefer to have all of my apps use their own gem versions. Putting everything into system is a big mess and a dependency nightmare on updates.
Next we need to make sure your app is setup to use the bundler gem. You need to modify your environment.rb and boot.rb
Make sure you change the application name to your name. Really you’re only adding the single line for the GEM_PATH
I was using the suggestions in the wiki but I eventually figured out that Dreamhost wasn’t properly picking up my gems even with the changed GEM_PATH. Adding the ‘Gem.clear_paths’ to boot.rb allowed the gems to be seen. This is what finally cracked the problem.
Hopefully this works for you.
Posted: May 3rd, 2010 | Author: jgeiger | Filed under: Uncategorized | No Comments »

It was a minimum of 3.5MB, peaking to 7+MB.
Posted: April 30th, 2010 | Author: jgeiger | Filed under: ruby, web | Tags: bundler, dreamhost, rails 3, ruby | 2 Comments »
I’ve posted before about trying to use rails 3 with bundler and dreamhost. This is now not possible. The shared servers for dreamhost use rubygems 1.3.5. In order to use the current version of bundler you need rubygems 1.3.6.
If you are a dreamhost user please make sure to vote up the install rubygems 1.3.6 suggestion from the panel (panel.dreamhost.com) For a company that has been good about supporting ruby and rails this is something that needs to get fixed ASAP.
Posted: April 26th, 2010 | Author: jgeiger | Filed under: web | Tags: facebook, fail, privacy | No Comments »
Hmmm. They contradict themselves…

As Facebook expands, I’m getting more concerned about the “privacy” they provide. There is more than one example of how they said they would not share information and changed the ToS to begin sharing that same information… without asking me. I don’t like that. I don’t have anything particularly personal up there but the idea that they just do what they want when they want doesn’t sit well with me.
Posted: April 6th, 2010 | Author: jgeiger | Filed under: mongodb, ruby, web | Tags: mongodb, mongoid, ruby | 1 Comment »
Had a bit of an issue with will_paginate and mongoid. I couldn’t find an example of how to sort the pagination query and paginating without a defined sort order defeats the purpose.
paginate(:page => page, :per_page => size, :sort => [['ontology_term_id', :desc], ['_id', :asc]])
Instead of using “order” or “order_by” you can just use “sort” with an array of arrays.