Technology Insights

Generating RDoc HTML files for your Rails project

To generate Rdoc HTML documentation files for your Rails project, run:   ruby rake doc:app This will create the following directory structure in your #{RAILS_ROOT}/doc/app directory: classes (dir) files (dir) created.rid fr_class_index.html fr_file_index.html fr_method_index.html index.html rdoc-style.css Here are some the other RDoc related rake tasks (listed by running rake -T) ruby rake doc:app    …

Code Snippets

MySQL Ruby Gem: `require’: no such file to load — mysql (LoadError)

I am starting to learn ruby and am working on a test script to import some data into a MySQL database. I am using the below code found on kitebird.com to first get the MySQL connection from Ruby working. The code was producing an error which I figured might be because I installed the MySQL Ruby gem instead of installing the MySQL Ruby module from source.

The below code attempts to connect to the MySQL server to return the MySQL server version.