Sunday, July 12, 2009

Thirty-seven Reasons I Love Ruby

I won't bother giving the history of the Ruby language here. For those of you who haven't heard of it, the definitive web site is www.ruby-lang.org, and comp.lang.ruby is the newsgroup. For those who have, I present to you the reasons I love this (relatively) new language. You may also visit my main Ruby page if you didn't come from there.

1.It's object-oriented. What does that mean? Well, for every ten programmers, there are twelve opinions as to what OOP is. I will leave it your judgment. But for the record, Ruby does offer encapsulation of data and methods within objects and allows inheritance from one class to another; and it allows polymorphism of objects. Unlike some languages (C++, Perl 5, etc.) Ruby was designed from the beginning to be object-oriented.
2.It's a pure OOP language. Am I being redundant? I don't think so. By this we mean that everything, including primitive data types such as strings and integers, is represented as an object. There is no need for wrapper classes such as Java has. And in addition, even constants are treated as objects, so that a method may be invoked with, for example, a numeric constant as a receiver.

3. It's a dynamic language. For people only familiar with more static languages such as C++ and Java, this is a significant conceptual leap. It means that methods and variables may be added and redefined at runtime. It obviates the need for such features as C's conditional compilation (#ifdef), and makes possible a sophisticated reflection API. This in turn allows programs to become more "self-aware" -- enabling runtime type information, detection of missing methods, hooks for detecting added methods, and so on. Ruby is related to Lisp and Smalltalk in this respect.

4. It's an interpreted language. This is a complex issue, and deserves several comments. It can be argued that performance issues make this a negative rather than a positive. To this concern, I reply with these observations: 1. First and foremost: A rapid development cycle is a great benefit, and it is encouraged by the interpreted nature of Ruby. 2. How slow is too slow, anyway? Do some benchmarks before you call it slow. 3. Though some will criticize me, I will say this anyway: Processors are getting faster every year. 4. If you absolutely need the speed, you can write part of your code in C. 5. Finally, in a sense, it is all a moot point, since no language is inherently interpreted. There is no law of the universe that says a Ruby compiler cannot be written.

5.It understands regular expressions. For years, this was considered the domain of UNIX weenies wielding clumsy tools such as grep and sed, or doing fancy search-and-replace operations in vi. Perl helped change that, and now Ruby is helping, too. More people than ever recognize the incredible power in the super-advanced string and text manipulation techniques. Doubters should go and read Jeffrey Friedl's book Mastering Regular Expressions. So should non-doubters.

6. It's multi-platform. It runs on Linux and other UNIX variants, the various Windows platforms, BeOS, and even MS-DOS. If my memory serves me, there's an Amiga version.

7. It's derivative. This is a good thing? Outside of the literary world, yes, it is. Isaac Newton said, "If I have seen farther than others, it is because I stood on the shoulders of giants." Ruby certainly has stood on the shoulders of giants. It borrows features from Smalltalk, CLU, Lisp, C, C++, Perl, Kornshell, and others. The principles I see at work are: 1. Don't reinvent the wheel. 2. Don't fix what isn't broken. 3. Finally, and especially: Leverage people's existing knowledge. You understand files and pipes in UNIX? Fine, you can use that knowledge. You spent two years learning all the printf specifiers? Don't worry, you can still use printf. You know Perl's regex handling? Good, then you've almost learned Ruby's.

8. It's innovative. Is this in contradiction to #7 above? Well, partly; every coin has two sides. Some of Ruby's features are truly innovative, like the very useful concept of the mix-in. Maybe some of these features will be borrowed in turn by future languages. (Note: A reader has pointed out to me that LISP had mix-ins at least as far back as 1979. That's purely ignorance on my part; I shall have to find a better example, and make sure of it.)

9. It's a Very High-Level Language (VHLL). This is subject to debate, because this term is not in widespread use, and its meaning is even more disputable than that of OOP. When I say this, I mean that Ruby can handle complex data structures and complex operations on them with relatively few instructions, in accordance with what some call the Principle of Least Effort.

10. It has a smart garbage collector. Routines like malloc and free are only last night's bad dream. You don't even have to call destructors. Enough said.

11. It's a scripting language. Don't make the mistake of thinking it isn't powerful because of this. It's not a toy. It's a full-fledged language that happens to make it easy to do traditional scripting operations like running external programs, examining system resources, using pipes, capturing output, and so on.

12. It's versatile. It can do the things that Kornshell does well and the things that C does well. You want to write a quick ten-line hack to do a one-time task, or a wrapper for some legacy programs? Fine. You want to write a web server, a CGI, or a chess program? Again, fine.

13. It's thread-capable. You can write multi-threaded applications with a simple API. Yes, even on MS-DOS.

14. It's open-source. You want to look at the source code? Go ahead. Want to suggest a patch? Go ahead. You want to connect with a knowledgeable and helpful user community, including the language creator himself? You can.

15. It's intuitive. The learning curve is low, and once you get over the first hump, you start to "guess" how things work� and your guesses are often correct. Ruby endeavors to follow the Principle of Least Astonishment (or Surprise).

16. It has an exception mechanism. Like Java and C++, Ruby understands exceptions. This means less messing with return codes, fewer nested if statements, less spaghetti logic, and better error handling.

17. It has an advanced Array class. Arrays are dynamic; you don't have to declare their size at compile-time as in, say, Pascal. You don't have to allocate memory for them as in C, C++, or Java. They're objects, so you don't have to keep up with their length; it's virtually impossible to "walk off the end" of an array as you might in C. Want to process them by index? By element? Process them backwards? Print them? There are methods for all these. Want to use an array as a set, a stack, or a queue? There are methods for these operations, too. Want to use an array as a lookup table? That's a trick question; you don't have to, since we have hashes for that.

18.It's extensible. You can write external libraries in Ruby or in C. In addition, you can modify the existing classes and objects at will, on the fly.

19. It encourages literate programming. You can embed comments in your code which the Ruby documentation tool can extract and manipulate. (Real fans of literate programming may think this is pretty rudimentary.)

20. It uses punctuation and capitalization creatively. A method returning a Boolean result (though Ruby doesn't call it that) is typically ended with a question mark, and the more destructive, data-modifying methods are named with an exclamation point. Simple, informative, and intuitive. All constants, including class names, start with capital letters. All object attributes start with an @ sign. This has the pragmatism of the old "Hungarian notation" without the eye-jarring ugliness.

21. Reserved words aren't. It's perfectly allowable to use an identifier that is a so-called "reserved word" as long as the parser doesn't perceive an amibiguity. This is a breath of fresh air.

22. It allows iterators. Among other things, this makes it possible to pass blocks of code to your objects in such a way that the block is called for each item in the array, list, tree, or whatever. This is a powerful technique that is worth exploring at great length.

23. It has safety and security features. Ruby borrows Perl's concept of tainting and allows different levels of control (levels of paranoia?) by means of the $SAFE variable. This is especially good for CGI programs that people will try to subvert in order to crack the web server.

24. It has no pointers. Like Java, and with a grudging nod to C++, Ruby does not have the concept of a pointer; there is no indirection, no pointer arithmetic, and none of the headaches that go with the syntax and the debugging of pointers. Of course, this means that real nuts-and-bolts system programming is more difficult, such as accessing a control-status register for a device; but that can always be done in a C library. (Just as C programmers drop into assembly when necessary, Ruby programmers drop into C when they have to!)

25. It pays attention to detail. Synonyms and aliases abound. You can't remember whether to say size or length for a string or an array? Either one works. For ranges, is it begin and end, or first and last? Take your pick. You spell it indices, and your evil twin spells it indexes? They both work.

26. It has a flexible syntax. Parentheses in method calls can usually be omitted, as can commas between parameters. Perl-style quotes allow arrays of strings without all the quotation marks and commas. The return keyword can be omitted.

27. It has a rich set of libraries. There is support for threads, sockets, limited object persistence, CGI programs, server-side executables, DB files, and more. There is some support for Tk, with more on the way.

28. It has a debugger. In a perfect world, we wouldn't need debuggers. This is not a perfect world.

29. It can be used interactively. Conceivably it could be used as a sort of "Kornshell squared." (This is the most contested item on this page, and I am forced to concede that Ruby is not really good as a shell. I still maintain, though, that a Ruby-based shell would be a good thing.)

30. It is concise. There are no superfluous keywords such as Pascal's begin, then after if, do after while. Variables need not be declared, as they do not have types. Return types need not be specified for methods. The return keyword is not needed; a method will return the last evaluated expression. On the other hand... it is not so cryptic as C or Perl.

31. It is expression-oriented. You can easily say things like x = if a<0 then b else c end.

32. It is laced with syntax sugar. (To paraphrase Mary Poppins: A spoonful of syntax sugar helps the semantic medicine go down.) If you want to iterate over an array x by saying for a in x, you can. If you want to say a += b instead of a = a + b, you can. Most operators are really just methods with short, intuitive names and a more convenient syntax.

33. It has operator overloading. If I am not mistaken, this originated long ago in SNOBOL, but was popularized more recently by C++. It can be overdone or misused, but it can be nice to have. Additionally, Ruby defines the assignment version of an operator automagically; if you define +, you get += as a bonus.

34. It has infinite-precision integer arithmetic. Who cares about short, int, long? Just use a Bignum. Admit it, you always wanted to find the factorial of 365. Now you can.

35. It has an exponentiation operator. In the old days, we used this in BASIC and FORTRAN. But then we learned Pascal and C, and learned how evil this operator was. (We were told we didn't even know how the evaluation was done -- did it use logarithms? Iteration? How efficient was it?) But then, do we really care? If so, we can rewrite it ourselves. If not, Ruby has the good old ** operator you loved as a child. Enjoy it.

36. It has powerful string handling. If you want to search, substitute, justify, format, trim, delimit, interpose, or tokenize, you can probably use one of the built-in methods. If not, you can build on them to produce what you need.

37. It has few exceptions to its rules. The syntax and semantics of Ruby are more self-consistent than most languages. Every language has oddities, and every rule has exceptions; but Ruby has fewer than you might expect.
Readmore »»

Friday, May 22, 2009

All About Gaining an MCSE Certification

Most of us probably know by now that the Microsoft Company's Windows operating system is extremely common these days. If you have a computer, the odds are pretty high that you are working in a windows based environment. It seems like everyone has dealt with Windows at one point or another. So it should not come as much of a shock that most employers require a Microsoft certification as a prerequisite to employment or even career advancement in most fields. MCSE simply stands for Microsoft Certified Systems Engineer and is actually the most widely recognized and used professional certification in the field of Information Technology, or IT for short.

Having this certification actually enables the IT professionals to be able to analyze business requirements, as well as design, build, and later implement the infrastructures for their business solutions based on that common Microsoft Windows platform, and the server software.

In order to obtain a Microsoft Certified Systems Engineer certification, one must pass a series of tests that deal with network security, server operating systems, and also basic computer network infrastructure engineering. Microsoft Certified Systems Engineer is also available for two different Windows systems, being Windows Server 2003 and Windows 2000, and each has their own specific set of exams. In order to obtain certification for Windows 2000, there is one core exam that is followed by two elective exams. However, for the Windows 2003 certification, there is only one core exam and one elective exam. Each one of these tests will run around $125, and take two or three hours to finish. There are fifty to ninety questions on each test. However, the time and money you spend on getting trained and certified in MCSE will be well worth it in the long run.

The MCSE training courses that you will have to take in order to take your certification tests will probably cost you around $250 for a package that includes all you need to train on the subject and be able to successfully pass a certification exam. Generally, you will be looking at about a thousand hours of training on the subject, and most package deals also come with at least a years worth of access to the online MCSE library, which will help you immensely. The very best thing about these MCSE training courses is that many of them can be found online, so you never have to leave the comfort of your own home. You can learn at your own pace, and in an environment that is the most comfortable to you.

It is also very easy to find reputable Microsoft Certified Systems Engineer training programs online. The only thing you need to do is type MCSE into your search engine, and the odds are very high that you will instantly be presented with thousands of web sites that can help you with every aspect of your MCSE training, as well as the professional courses that you will need in order to pass your certification tests.

Readmore »»

How to Prepare For the American College Certification

The demand of IT certifiers is growing very fast in with each passing day. The amount of candidates in the different certifications programs is increasing with the same speed as the requirements are increasing. The American College is one of those IT (information technology) institutes who only focus on academic excellence and social relevance. It has a big pioneer role in the development of college autonomy all over the world. It started a very successful beginning of a choice based credit system. The American College is a perfect platform for the candidate who wants to be certified.


The candidate will have to work very hard and pass through an intense training for the certification. The IT (information technology) institutes are working very hard to give the education, these institutes provide all the information and the whole training which is required for the these certifications. The candidate will have to struggle himself with the studies by using the Self Exam Engine, which is a perfect way to check his own preparation. The Self Exam Engine is a trusted in providing training tools for these Certification from American College. These training tools are especially designed for easy learning and complete success. The Self Exam Engine is also available online from all the leading American College websites. These sites have all the information, guides including training tools and self testing exams related to the certification course. The candidate can prepare well for his certification from practice Questions and their answers with complete explanations. And these training tools or information are updated on regular basis. The online certification training will not only guarantee candidate's success in this certification but it will definitely give success to the candidate in his professional career.

The American College certification study material, Brain Dumps, question answers with their explanations and notes are designed to give the candidate ease and assistance to help him in passing these certifications in his first attempt. The candidates are getting the following training to pass their exams, study guide, Brain dumps, Transcended Torrent, Actual American College tests, and self test exams etc. these techniques will give a new editions of real exams which will help the candidate to enhance his technical skills and knowledge for the professional career. The brain dumpers are very useful for increasing the candidate's brain power and are very useful to understand the terminologies of exams. The practice Questions are prepared by the group of highly qualified certified professionals who have the bundles of experience in this field. The group of experts who design the training tools always try to give candidate a real exam environment in these practice exams.

Readmore »»

CIW Certification Courses For Focused IT Specialists

CIW certification courses also known as the Certified Internet Web Professional program is a vendor-neutral Internet certification program. It is a Web Technology standard that is a number of governments, businesses and academic institutions are adopting today. The core curriculum of CIW focuses on several standards like web design, networking, security and administration.

The Need For Synergists

Today with increasing progressive changes taking place in the IT industry, specialists are being replaced by synergists. IT synergists are specialists that have a broader skill set. Their set of skills includes handling interdependent systems like integrating, designing and troubleshooting. And for gaining such skills it is very important to acquire people with varied experience and multidiscipline knowledge.

The above need is met by CIW certification courses. Such courses hone the skills of professionals and turn them into IT synergists that have the best knowledge of the industry standards.

Benefits Of CIW Certification

Professional CIW certification courses can help one master today's technology driven world and achieve their career goals. Some more benefits of becoming a CIW professional are:

- Inclusion of industry-recognized credentials to the resume.
- Specialized and defined job role skills.
- A jump in the salary structure and increased job responsibilities.
- A sharp advancement within the organization.
- A different category than the co-workers.
- Pathway to up-to-date skills and knowledge in the fast evolving technology world.

Several students have experienced a rise in their career after successful completion of their CIW certification courses. If you too wish to gain a competitive edge over your competitors then enroll for a CIW course today. These courses are beneficial both for employers and employees. For employees, these courses act as the direct gateway to several career opportunities. For organizations and employers, CIW certification helps reduce hiring and training related costs thus creating a skilled workforce within the company itself.

CIW Certification Exams And Courses

There are several CIW certification courses to choose from. For beginners there are foundational CIW Associate certification programs and for advanced learners there are CIW Professional certifications and advanced-level Master certification programs.

Some commonly sought after CIW certification courses are:

- CIW Associate: For gaining basic hands-on skills and knowledge for Internet professionals. It includes basic knowledge of network infrastructure, Internet technologies and Web authoring.
- CIW Associate Design Specialist: A certification pathway for Web design students with two popular CIW courses combines into one.
- CIW Professional: Those who have already earned an Associate certification can attain a CIW Professional certification.
- Master CIW Designer: Certification for a successful career as a Web designer, Web marketing specialist, Creative director or e-commerce developer.
- CIW Database Design Specialist: A new certification program that enables gaining knowledge of database design principles, theory and their application.
- Master CIW Administrator: For professionals who are interested in a career in intranet administration or networking system.
- CIW Security Analyst: The job of a security analyst is to protect an organization's assets and operations. The certification course is allowed to those who have already earned a Master CIW Administrator certification.
- Master CIW Web Site Manager: Helps the student gain a cross-functional set of Web skills that would help take up the role of a Web manager.
- Master CIW Enterprise Developer: Helps professionals develop enterprise web-enabled applications and implement the same to e-business solutions.

James Copper is a writer for http://www.trainingplace.co.uk where you can find information on CIW certification courses

Article Source: http://EzineArticles.com/?expert=James_Copper



Readmore »»

CCNA Certification - The Door to the Best Networking Careers

The CCNA (Cisco Certified Network Associate) certification is an entry level certification for networking professionals. It is the first step to higher level certifications, such as Cisco Certified Network Professional (CCNP) and Cisco Certified Internet work Expert (CCIE) certification.

The CCNA certification is the best option for the computer net workers, field technicians, IT helps desk engineers, and other professionals of IT associated with controlling the computer networking process. This certificate is considered as the basic qualification for installing, operating, configuring and troubleshooting a mid-sized switched and routed network. A CCNA certified professional is considered to be trained in working with a networking environment that includes a group of switched networks. In simple terms, the CCNA certified professional is able to manage a host of computer routed networks connected through switches.


With the increasing demand for networking specialists, the value of the CCNA certification is also going up in the IT industry's job market. This certification is considered to be a benchmark for sorting out the best and the most efficient technicians in the field of network management. The CCNA is offered on the basis of a test that is conducted by Cisco. The examination is structured by emphasizing on the questionnaire that has drag and drop options, multiple choice single answers, multiple choice multiple answers, simulations and fill in the blank type of questions. However, although the structure seems to be simple, professional training and guidance is required to be successful in the exams. As is obvious, the nature of the examination is purely technical and special knowledge of the networking environments and solutions are required to pass in the test. Therefore, the best option for getting certified is to take help of professional experts. There are several institutions that focus on CCNA examination training from where one can get adequate support and guidance.

To get CCNA certification, one requires specialized knowledge in the fields of installation, configuration, design, troubleshooting, and maintenance and management of networks. As a matter of fact, the CCNA examination training focuses on these aspects of networking in great detail. A potential candidate applying for CCNA certification is also trained in practical networking environment so that once he/she gets certified and starts working, he/she faces no problem in handling the IP or non IP networks. As practical knowledge is what matters the most, the examination is also based upon this specific aspect. It is wrong to believe that without having any specialized knowledge, one can get certified. As mentioned earlier, since it is considered to be a benchmark for the networking professionals, the exams take care of the minute details as well as proficient knowledge of the candidates. Therefore, those who get certified are necessarily the best in the field of network management and administration.

In the competitive market of networking jobs, it is crucial to have specialized knowledge and professional certification. The CCNA certification is accepted and recognized all over the world. Therefore, it definitely adds value to the credentials of the candidates looking for a suitable job in networking. Moreover, the examination is also used as a tool for sorting out the best networking professionals who would be responsible for the management and maintenance of the networking environments.

Today, some say that the CCNA certification is the best tool to shape up the networking career.


Readmore »»

Monday, May 11, 2009

Installing Ruby on Rails on Mac OS X

Leopard (10.5)

Ruby (1.8.6), Ruby Gems (1.0.1) and Rails (1.2.3) ship with the latest version of OS X (10.5, Leopard).

You may want to upgrade Rails to take advantage of the latest and greatest improvements. The version of Rails that ships with OS X is rather old (in Rails development terms).

You should also make sure you have xCode tools installed from your OSX disk, since you will likely run into the need to compile applications during your run with Rails.

To accomplish this, you should first update Ruby Gems.

$ sudo gem install rubygems-update
$ sudo update_rubygems

Then a simple re-installation of Rails will get you to the latest release.

$ sudo gem update
$ sudo gem update --system
$ sudo gem install rails

Tiger (10.4) and Panther (10.3)

RubyOSX v1.2 is a one click installer that will install Ruby 1.8.6, RubyGems 0.9.4, Mongrel 1.0.1 and SQLite 3.4.0. for Tiger (10.4) and Panther (10.3). It however, will not install Rails. After installing RubyOSX you should first update Ruby Gems.

$ sudo gem install rubygems-update
$ sudo update_rubygems

Then a simple installation of Rails will get you to the latest release.


$ sudo gem install rails

Alternative Method for Leopard (10.5) and Tiger (10.4)
Bitnami RubyStack

Using Bitnami RubyStack with FiveRuns TuneUp BitNami RubyStack (1.4-beta-1) ships with the following:

1.
Ruby 1.8.6 and 1.9.0 developer branch
2.
RubyGems 1.2.0
3.
Rails 2.1.1
4.
ImageMagick 6.3.6
5.
Subversion 1.4.6
6.
SQLite 3.5.1
7.
MySQL 5.0.51a
8.
Apache 2.2.8
9.
Mongrel Web Server 1.1.5
10.
Capistrano 2.5
11.
PHP 5.2.6
12.
phpMyAdmin 2.11.2.2
13.
Git 1.5.5
14.
Nginx 0.6.30

Note: Bitnami RubyStack will not support Passenger, as it does not support Windows platform

If you select Developer version then you will get a choice of installing PhpMyAdmin. In developer version Apache isn't preconfigured

If you select Production version then Bitnami will install Mongrel Cluster, with Apache preconfigured to act as a load balancer for Mongrel

Enter MySql 'root' password, port for Apache webserver, OpenSSL and Mysql

Bitnami will install 3 databases, Developer, Production and Test databases. Here you should add a user that will have rights to these databases.

All Done.

Macports

You may wish to use MacPorts to install Rails if you are using Leopard (10.5), Tiger (10.4) or Panther (10.3).

First you should Download the latest version of Xcode Tools if you have the currently shipping release of Mac OS X. Without Xcode Macports will not work

Download and install the appropriate version of Macports from MacPorts install page. MacPorts can be installed with a .dmg image using a familiar step-by-step installer. This will take quite some time to install, so be patient, it downloads the entire ports repository during “Finishing Installation” phase.
Command Line option

Open the Terminal application and type the following command, followed by the return key. It will most likely prompt you to enter your password.

$ sudo port install rb-rails

or type in the complete path like so

$ sudo /opt/local/bin/port install rb-rails

This will install the required rails dependencies like Ruby, RubyGems, Rake and SQLite. This will also take a very long time, depending on your computer speed, since everything is compiled from source.

That's it! Now you're ready to create new Rails applications.

If you want you can also install Mongrel, Capistrano, Mysql and Rspec using the following command.

$ sudo port install rb-capistrano rb-mongrel_cluster rb_mysql rb-rspec-rails

GUI option

Install Porticus, which is a gui for Macports Package Manager. Search for rails in the search bar in the top right corner

Select rb-rails and click the install icon on the top right corner. It will install all the required dependencies. All done, rails is now installed. If you want you can also install rb-mongrel_cluster. Although its recommended to use Passenger with apache.
Readmore »»

Installing Ruby on Rails on Windows

Pieces You Need

*
Ruby
*
RubyGems
*
Rails (Gem)
*
A Database Engine

Install Ruby and RubyGems

Get the latest One-Click Ruby Installer, current version 1.8.6-26. Run this, and select all the defaults. This will install Ruby under C:\ruby, and install RubyGems for you. The README at the end of the installation will show you all the versions of each piece that it installed. You need to update gems after installation:

$ gem update --system

Before continuing, check to see that c:\ruby\bin is in your PATH by typing “path” at a command prompt. This will ensure that you can run ruby.exe from anywhere (which you'll need to run from your project root). If for some reason it's not there, you'll need to add it (how this is done can vary depending on which Windows Version you are running).
Install Rails


Rails is easy to install now, thanks to RubyGems. Simply use gem to install it at a command prompt:

$ gem install rails

This will take awhile, so go get a snack. It may even look like it's not doing anything at first, so don't worry that it's hanging. This will install all the code, test code, ri documentation, and RDoc documentation for Rails.
Install a Database Engine

Rails is completely DB-agnostic, so we'll describe how to install two of the more popular Database Engines: SQLite and MySQL.
How to Install SQLite

SQLite is the default database type that Rails looks for, and it's a great, lightweight DB for Development. We'll install SQLite3 here.

You need two files from the SQLite download page:

*
the SQLite Command Line Tool
*
the SQLite DLL

Unzip them and put the three extracted files in your ruby\bin directory (usually at C:\ruby\bin). Now install the sqlite3-ruby gem:

$ gem install sqlite3-ruby -v 1.2.3

How to Install MySQL

Download MySQL Community Server and install it. If you also do PHP programming, check out WAMP for an easy installation as well.

To use MySQL in Rails versions greater than 2.1, you'll also need the MySQL adapter:

$ gem install mysql

Because MySQL is not the default adapter, we'll have to edit our database.yml file later.
Setup a First Project

Setting a Rails project is a one-line affair (from the command prompt):

$ rails myprojectname

This will build a directory, in which it will build the entire blank Rails project skeleton. To see your fresh project in action, navigate to your project root and run script\server:

$ cd myprojectname
$ ruby script\server

Then, navigate to http://localhost:3000/ in your browser, and you should see the default Rails “Welcome Aboard” page.

Out of the box, Rails uses the SQLite3 adapter and creates the DB in the db directory. If you look at your database.yml file (in \config), you'll see a database entry for your development, test, and production databases. Each should look something like this:

development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000

This means in development mode Rails is using the sqlite3 adapter to communicate with the database at db\development.sqlite3. This is fine during development, but in production, you'll probably want something beefier. You can change any of the entries to read from a different database type. Here's what an example MySQL entry would look like:

development:
adapter: mysql
database: myprojectname_development
username: devrailsuser
password: devrailspassword
host: localhost
Readmore »»