budsus's blog

Hi all, I just want to share about an IDE that already replaced the RadRails for Ruby on Rails IDE, i.e. Aptana. I use this new kind of IDE to create static HTML/XHTML, CSS, JavaScript, Ruby on Rails. This is a greate IDE. I think some of you already use this too. OK..we have to migrate to Aptana.. not RadRails again!

Hi all, I really sorry 'cause I never write at this blog for very long time :D. I want to try to start it again with a small share information. This article is very interested me to figure out about how to programming it with Ruby. Sorry if this blog just like a bookmark.

Creating Games in Ruby

May be we can try to make ruby as our base language programming.

I have upload the Ruby Intepreter for Symbian S60 3rd Edition. You can download from this link, and install it on your Symbian s60 3rd phone cell. There are some limitation features that you can not find in this version. For example, after I tried this intepreter on my N73, I could not pass a parameter when run a script that receive a parameter. Once again, please refer to the official Ruby for Symbian site.

This is a big jump step for Netbean 6 preview (M9) which is including Ruby and Ruby on Rails plugin in it. I use Netbean since 3.2 version to develop any desktop java application. Now with Netbean 6, I also can develop Ruby on Rails application easily. Here are some Ruby/RoR features that you can use with Netbean 6 :

* Tools > Ruby Gems
this tool will provide you gems package management easily. Netbean 6 will include automatically ActiveRecord-JDBC gems module.

* There are two sample interesting Ruby on Rails applications, i.e. Flickr on Rails Sample App and Ruby Weblog Sample App. With this sample, we can learn many things about Ruby on Rails tips and trick.

* You can create Ruby / Ruby on Rails projects easily

* JRuby is a default ruby intepreter in Netbean 6.

I will continue this conversation with how to develop a simple RoR application with Netbean 6.

If you want to build Ruby on Rails application to connect to Oracle10g database, you have to install Ruby/OCI8 from Rubyforge. After downloading and extracting the file, please read README file. Before compiling, I have to check the Oracle connection and prepare some environment variables :

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=budsus; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$ORACLE_HOME/bin:$PATH; export PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:${LD_LIBRARY_PATH}

Here is the sqlplus command to check the Oracle database connection from my session :

sqlplus hr/hr@localhost:1521/budsus

If you get the SQL> prompt from SQL*Plus environment, you have successfull to connect to Oracle database.

Here are some steps to create a simple RoR application to access HR.EMPLOYEES table :

1. rails hr

2. I read a helpful documentation from http://wiki.rubyonrails.org/rails/pages/Oracle to help me to understand about the database configuration. Here is my database.yml configuration :

development:
  adapter: oci
  host: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=localhost)(Port=1521))(CONNECT_DATA=(SID=budsus)))
  username: hr
  password: hr

(note: if you are using OracleXE, you must use XE as SID)

3. ruby script/generate model Employee

4. ruby script/generate scaffold Employee

5. ruby script/server

From my browser, I can access http://localhost:3000/employees/list. I hope this article can help you. Thanks

Syndicate content