Rails 3 and Bundler on Scalarium

As Scalarium supports virtually any software stack thanks to custom Chef Cookbooks, running Rails 3 is not a problem. To use Rails 3 and Bundler, you need to set up Bundler.

Currently you still need to override the database.yml template if you want to use the msql2 gem. To do this create a file named rails/templates/default/database.yml.erb in your custom cookbooks with the following content:

<% (['development', 'production'] + [@environment]).uniq.each do |env| -%>
<%= env %>:
  adapter: mysql2
  database: <%= @database[:database] %>
  encoding: utf8
  host: <%= @database[:host] %>
  username: <%= @database[:username] %>
  password: <%= @database[:password] %>
  reconnect: <%= @database[:reconnect] ? 'true' : 'false' %>

<% end -%>

This enabled the mysql2 gem for database access.