SyntaxHighlighter

Monday, February 11, 2008

A Ruby on Rails application with no database

If you have a project that has no database (it may be hitting a web service), you will want to remove ActiveRecord, ActiveResource, and ActionMailer.

To do this, uncomment the line in environment.rb

19 # Skip frameworks you're not going to use (only works if using vendor/rails).
20 # To use Rails without a database, you must remove the Active Record framework
21 config.frameworks -= [ :active_record, :active_resource, :action_mailer ]

It took me a little while to find why I was getting the mysql error as I didn't have an ActiveRecord model and the stack trace for the error isn't helpful.

Mysql::Error (#28000Access denied for user 'root'@'localhost' (using password: NO)):
/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:523:in `read'
/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:153:in `real_connect'
/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:471:in `connect'
/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:165:in `initialize'
/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:88:in `mysql_connection'
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:291:in `connection='
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:259:in `retrieve_connection'
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection'
/vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
/vendor/rails/actionpack/lib/action_controller/caching.rb:677:in `perform_action'
/vendor/rails/actionpack/lib/action_controller/base.rb:524:in `process_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
/vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in `process'
/vendor/rails/actionpack/lib/action_controller/base.rb:388:in `process'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:171:in `handle_request'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in `dispatch'
/vendor/rails/railties/lib/fcgi_handler.rb:101:in `process_request'
/vendor/rails/railties/lib/fcgi_handler.rb:149:in `with_signal_handler'
/vendor/rails/railties/lib/fcgi_handler.rb:99:in `process_request'
/vendor/rails/railties/lib/fcgi_handler.rb:77:in `process_each_request'
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:612:in `each_cgi'
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:609:in `each_cgi'
/vendor/rails/railties/lib/fcgi_handler.rb:76:in `process_each_request'
/vendor/rails/railties/lib/fcgi_handler.rb:50:in `process!'
/vendor/rails/railties/lib/fcgi_handler.rb:24:in `process!'
/public/dispatch.fcgi:24

Thursday, February 07, 2008

Why companies adopt Ruby on Rails

This is a great thesis from Michael Barbosa, a bachelor student at the Erasmus Universiteit Rotterdam in the Netherlands. It was written in July, 2007.

http://thesis.cicaboo.com/

The last half of the document is his findings. Companies were surveyed, here's some of the results. Go to his site and download the pdf to see all the results. It's interesting and reinforcing to what you probably already know.

97.9% Increase in productivity
92.5% Rails enables faster development of web applications than competing frame-works
91.8% Joy in development
90.4% With rails, web applications are structured well