Skip to content

Instantly share code, notes, and snippets.

@veldtmana
Created October 30, 2011 09:00
Show Gist options
  • Select an option

  • Save veldtmana/1325721 to your computer and use it in GitHub Desktop.

Select an option

Save veldtmana/1325721 to your computer and use it in GitHub Desktop.
MySQL database.yml config for Torquebox... (you have to use the 'activerecord-jdbc-adapter' and 'jdbc-mysql' gems)
development:
adapter: jdbc
encoding: utf8
username: root
password: password
driver: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/myappname_development
test:
adapter: jdbc
encoding: utf8
username: root
password: password
driver: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/myappname_test
production:
adapter: jdbc
encoding: utf8
username: root
password: password
driver: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/myappname_production
@veldtmana
Copy link
Author

This config should be used instead of the typical 'activerecord-jdbcmysql-adapter' gem that works using webrick.

Stack:
Rails 3.0.10
jruby 1.6.5

torquebox-server 2.x gem as opposed to installing and configuring torquebox
(see http://torquebox.org/news/2011/06/10/torquebox-gem/)
Ubuntu

following gems should be in gemfile:

  • activerecord-jdbc-adapter
  • jdbc-mysql

@veldtmana
Copy link
Author

Using this setup you cannot drop or create the db with a rake task...

console$ mysql -u root -p
mysql> create database myappname_development;

@veldtmana
Copy link
Author

Also the torquebox session store param makes running rake tasks a mess:

rake aborted!
uninitialized constant ActionDispatch::Session::TorqueboxStore

Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

fix it by adding:

begin
  puts ActionDispatch::Session::TorqueboxStore
rescue
  ActionDispatch::Session::TorqueboxStore = nil
end

to the top of config/initializers/session_store.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment