Web Programming Languages

Web Coding in Ruby

Unfortunately, Ruby is not installed on this server. Functions are disabled.

I know very little about Ruby. Like Python, it lacks curly braces. Like Basic and Pascal, it uses the keyword end to end a control block (loop). I am still learning.

I am learning that some function calls require the opening parenthesis to be immediately after the function name without white space. This is because the parentheses are optional, and the interpreter sees the parentheses and contents as a tuple if there is intervening white space. Unfortunately, this is not the "look" I like in my code; but I can live with it.

To make the CGI work, I needed to add this .htaccess file:

OPTIONS Indexes
AddHandler cgi-script .rb
Options +ExecCGI

I had to install the Ruby mysql gem and make a symbolic link as follows. The detailed instructions are in one of the links on this page. Because of this extra installation, I don't know if other servers will have this Ruby-MySQL support.

$ sudo gem install mysql
$ sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib \\
  /usr/lib/libmysqlclient.18.dylib