Y0rTz.it

... a ROR developer lost in IT

Test Subdomains with Cucumber and Capybara

While “cuking” on some rails app running on my local machine via passenger and apache on 2 different subdomains (domain1.local, domain2.local) I went through some weird hacking of pre-existing steps before realizing that my life could have been much more easier, and my code more readable by correctly configuring subdomains in Capybara.

SAVEPOINT active_record_-1 (ActiveRecord::StatementInvalid)

Today I was doing some integration testing with cucumber and I had to face with the following error:

Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-1’ at line 1: SAVEPOINT active_record_-1 (ActiveRecord::StatementInvalid)

Configure SSL on Ubuntu

Since I’ve found myself more than once redoing the same kind of stuff all over again, I am going to write out what were the steps I used to easily configure and setup Ssl on one of my Ubuntu based production boxes, assuring my rails app could run via passenger and apache and be accessed via https at https://mydomain.com.

This post focus on using OpenSSL, the most popular open source SSL implementation (IMHO).

Uninitialized Costant Bundler (NameError)

After deploying one of my rails apps to linode, while loading mydomain.com I was welcomed with the following error message:

Uninitialized Costant Bundler (NameError).

I’d like to document here how I went through fixing this issue, hoping this could save some other peeps’ precious time.

No metadata found! (Gem::Package::FormatError)

If you are using Bundler in one of your rails projects and you are struggling against the dreaded

1
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:111:in `initialize': No metadata found! (Gem::Package::FormatError)

error, as I did while trying to run “bundle install” in one of my rails apps (read more about this issue here), I have found out that (at least for me on my dev machine) a quick fix to get past this kind of issue was to simply throw a “config” file into my ~./bundle dir pointing to the location of the ~./bundle dir itself: