Archive for the ‘Ruby On Rails’ Category

Free book in what’s new in Ruby on Rails 2.1

Monday, June 16th, 2008

Congratulations for all Brazilian Railers! And a special thanks for Carlos Brando and to Marcos Tapajós who made the book.

This book contain what’s new in rails 2.1. Click here to download pdf version or here to read online…..

Popularity: 28% [?]

Ruby book for beginner

Saturday, June 7th, 2008

Sometimes people don’t know how to start learn ruby programming and still searching which book are suitable to them as a beginner. So I’m also as a beginner in ruby and rails programming, will suggest people to get Mr. Neighborly’s Humble Little Ruby Book as a reference to get start with ruby programming. This book will teach you the basic of ruby.

Quote from infoq.com

Mr. Neighborly’s Humble Little Ruby Book is a book about this fine language, but it is not a language book per se.  It is perhaps best described as a mix between your favorite novel, your favorite Spanish textbook, and a Richard Simmons exercise video: it walks you through the very basics of working with Ruby, but by the end of it, you’ll no doubt be sweatin’ it to the oldies.   It covers the base syntax of the language, including working with values, flow control, and object oriented programming, into some of the library functionality of Ruby, such as databases, web services, and string manipulation.

Expect this book to rock your world.  Or at least teach you a programming language.
144 pages, 6″x9″

You can download here to get free eBook in pdf format.


Table of contents

1 Welcome to Ruby
Basic Concepts of Ruby
Types in Ruby
Collections
Variables and the Like

2 Break it down now!
Methods
Blocks and Proc Objects
Modules
Files

3 Hustle and flow (control)
Conditionals
Loops
Exceptions

4 The System Beneath
Filesystem Interaction
Threads and Forks and Processes
Environment variables, command line
Win32 and Beyond

5 Looking Beyond Home
Networking and the Web
It’s Like Distributed or Something…
Data my base, please!

6 It’s a Library!
String Manipulation
Date/Time
Hashing and Cryptography
Unit testing

Appendix A Links and the Like
Appendix B High Performance Ruby with C/C++

Zemanta Pixie

Popularity: 28% [?]

Migration in rails 2.1

Wednesday, May 28th, 2008

Some new migration feature in rails 2.1,

  1. Migration version number was keep trak in database, that means new rails was replace ’shema_info’ with a new table called ’schema migrations’.The old ’schema_info’ in Rails 2.0 just save the number of latest migration that has been execute but ’schema migrations’ table was created to keep trak which migration already execute. In Rails 2.0, sometimes if you are working with another rails developer in same project or merge the branch, they might created a higher migration number then you. So if you run db:migrate, your migration file won’t execute. With the new implement in Rails 2.1 they eliminate this problem.
  2. Change the structure of migration file. See the image below..how different with the Rails 2.0.

Awesome ya….

Popularity: 60% [?]

Mac OS X 10.5 (leopard) setup for Rails

Saturday, May 24th, 2008

1.    Install Xcode 3.0 or newer
2.    Make the following entries exist in /etc/profile

  • export RC_ARCHS=i386
  • export DYLD_LIBRARY_PATH=”/usr/local/oracle/instantclient”
  • export SQLPATH=”/usr/local/oracle/instantclient”
  • export PATH=”/usr/local/oracle/instantclient:$PATH”

3.    Create folders

  • sudo mkdir -p /usr/local/src
  • sudo chgrp admin /usr/local/src
  • sudo chmod -R 775 /usr/local/src
  • cd /usr/local/src

4.    Get Ruby (note: check what the current stable version is)

  • curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p111.tar.gz
  • tar xzvf ruby-1.8.6-p111.tar.gz
  • cd ruby-1.8.6-p111
  • ./configure –enable-shared –enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
  • make
  • sudo make install
  • cd ..

5.    Ger RubyGems (note: check what the current stable version is

  • curl -O http://files.rubyforge.mmmultiworks.com/rubygems/rubygems-1.0.1.tgz
  • tar xzvf rubygems-1.0.1.tgz
  • cd rubygems-1.0.1
  • sudo /usr/local/bin/ruby setup.rb
  • cd ..

6.    Install Rails and any other gems you want

  • sudo gem install rails
  • sudo gem install rspec

Popularity: 42% [?]

Malaysia.rb May 2008 Meetup

Thursday, May 22nd, 2008

Date : Thursday, 29 May 2008
Time : 8.00pm - onwards
Location : Most probably Starbucks KL Sentral

Event :

This still under planning stage :)

Popularity: 29% [?]

Rails 2.1 Time Zone Support

Friday, May 16th, 2008

Check out here : http://mad.ly/2008/04/09/rails-21-time-zone-support-an-overview/
Credit to Geoff Buesing

Awesome…New feature in Rails 2.1. Now version Rails 2.1 RC1

Popularity: 39% [?]

Installing Oracle Instant Client for Intel Mac(leopard)

Sunday, May 4th, 2008

This is i found out how to connect ruby to oracle database

1.Download “Instant Client Package - Basic
2.Download “Instant Client Package - SDK
3.Unzip all instant client to ‘/usr/local/oracle/instantclient_10_2′ using sudo function

  • sudo unzip instantclient-basic-macosx-10.2.0.4.0.zip /usr/local/oracle
  • sudo unzip instantclient-sdk-macosx-10.2.0.4.0.zip /usr/local/oracle

4.Go to ‘/usr/local/oracle/instantclient_10_2′
5.Make symbolic links for dynamic libraries.

  • sudo ln -s libclntsh.dylib.10.1 libclntsh.dylib
  • sudo ln -s libocci.dylib.10.1 libocci.dylib

6.Create ‘/usr/local/oracle/network/admin’
7.Put your tnsnames.ora inside ‘/usr/local/oracle/network/admin’.

  • sudo mkdir /usr/local/oracle/network/admin

8.Setup enviroment in your .bash_profile script. In your home folder.
9.Then added :

export DYLD_LIBRARY_PATH=”/usr/local/oracle/instantclient_10_2″
export SQLPATH=”/usr/local/oracle/instantclient_10_2″
export TNS_ADMIN=”/usr/local/oracle/network/admin”
export NLS_LANG=”AMERICAN_AMERICA.UTF8″
export PATH=$PATH:$DYLD_LIBRARY_PATH

10.Relaunch Terminal application
11.Specify database connection in tnsnames.ora
12.Download ruby-oci8 and extract the file. Extract to any location you like.
13.Edit line 17 in ‘/usr/lib/ruby/1.8/universal-darwin9.0/rbconfig.rb’

  • change to ‘-arch i386′

14.Go to directory where you extracted ruby-oci8 source
15.Execute ruby-oci8 standard installation sequence:

  • ruby setup.rb config
  • make
  • sudo make install

16.Change back file ‘/usr/lib/ruby/1.8/universal-darwin9.0/rbconfig.rb’

  • change to ‘-arch ppc -arch i386′

17.Done. try connect to your oracle database

Popularity: 52% [?]

Making a Copy of an Object - Ruby

Saturday, April 19th, 2008

You want to make a copy of an existing object: a new object that can be modified separately from the original, Use Object#clone - makes a copy of the metaclass and instantiates the copy, instead of instantiating the object’s original class

example how to use clone :

s1 = 'foo'                             # => "foo"
s2 = s1.clone                          # => "foo"
s1[0] = ‘b’
[s1, s2]                               # => ["boo","foo"]

Popularity: 24% [?]

Ruby on Rails Wiki

Thursday, April 17th, 2008

http://railsapplication.com/

http://wiki.rubyonrails.org/rails

http://en.wikibooks.org/wiki/Ruby_on_Rails

http://wiki.netbeans.org/Ruby

http://wiki.oracle.com/page/Ruby+on+Rails?t=anon

Popularity: 25% [?]

What is EdgeRails in Ruby on Rails?

Thursday, April 17th, 2008

My friend ask me what is EdgeRails..this is what i found out :

‘EdgeRails’ is a term which means you are running a local copy of a developmental version of Rails(bleeding edge). It is an alternative to the more standard GemRails, which means you are running one of the stable releases.

Bleeding Edge‘ is a term that refers to technology that is so new (and thus, presumably, not perfected) that the user is required to risk reductions in stability and productivity in order to use it.

GemRails‘ is preferred method of installing Rails is through the packaging scheme RubyGems that makes it really easy to install libraries and keep them up to date

Advantage : get access to new features or bug fixes that are not in the most recent stable release. . Also EdgeRails allows you to run on computer without Rails installed

Disadvantage : developmental versions are not generally regarded to be stable. So it’s a tradeoff

How to use EdgeRails : embeded a (developmental) version of Rails within your application(copy into the vendor/rails directory) rather than using the version installed on your machine as a library

How to switch from Gemrails to EdgeRails :

  1. Run ‘rake rails:freeze:edgefrom application home directory to unpack the latest edge rails into application vendor/rails directory. This embeds the Rails framework into your application by using Subversion (svn) to copy the files from the developmental source code repository (dev.rubyonrails.org) into your vendor/rails directory
  2. To revert to GemRails, run command ‘rake rails:unfreeze‘.That command empties the vendor/rails directory

How to install and managing EdgeRails visit http://www.sitepoint.com/blogs/2006/07/11/installing-and-managing-edge-rails/

Visit http://ryandaigle.com/tags/Edge%20Rails to know what’s new in EdgeRails

Visit http://dev.rubyonrails.org/wiki to create ticket/bug report/patch

Popularity: 24% [?]