1.Installation

innateearthyInternet και Εφαρμογές Web

2 Φεβ 2013 (πριν από 4 χρόνια και 6 μήνες)

138 εμφανίσεις

Installation

We need to install:




The Ruby Interpreter



The Rails framework



The Java runtime environment



Net Beans



MySql



1.

Visit
http://rubyforge.org/projects/rubyinstaller

Download one click insta
ller.

If you’re running Linux, try:

http://rubyforge.org/projects/ruby


2.

Find the highest
-
numbered version with the word
stable
in its

description. Click this
version’s link to begin the download.


3.

Click Ru
n to run the installation file.

Alternatively, you can click Save to save the installation file on your hard drive. Then you can
find the installation file’s icon and double
-
click the icon to start running this file.


4
. Respond to any prompts during the i
nstallation.

You might see a dialog box asking whether you really want to install this

potentially dangerous
program. If you’re downloading the program from

http://rubyforge.org
, the chance that the
program contains a virus

(or any other malicious code) is

very, very small.

At some point in the
installation, you might also be given a list of components

to install, including Ruby itself, something named SciTE, and other

things. The installation
program permanently selects

the Ruby check box. (That’s good, be
cause to work with Ruby on
Rails,

you need this Ruby software.) But make sure that you also select the

RubyGems check
box.


5. When the installation is complete, click Finish.


Testing the Ruby installation
:


After installing the Ruby interpreter, you sho
uld test your new interpreter to

make sure that it’s installed
properly. This section shows you how to perform

a test.



1. If you run Windows XP, choose Start

Run. If you run Windows Vista,

simply choose Start.

A small Run dialog appears.


2. If you run W
indows XP, type
cmd
in the Run dialog’s text field. If you

run Windows Vista, type
cmd
in the Start Search field. Then, in both

cases, press Enter.

A white
-
on
-
black window appears. This is your computer’s
command

window.
The text
C:
\
WINDOWS
\
system32
\
cmd.ex
e
appears in the

command window’s title bar.


3. In the command window, type
irb
and then press Enter.

The letters
irb
stand for
interactive Ruby.
This
irb
command fires up

a very easy
-
to
-
use interface to the
Ruby programming system.


4. Type
puts "Hello"

and then press Enter.

You’ve just told Ruby to display the word
Hello
. Ruby displays
Hello
,

followed by some other junk. (See
Figure 2
-
4.)


Installing Rails
:


After installing Ruby, the installation of Rails goes fairly quickly.


1. Make sure you have a w
orking connection to the Internet.


2. If you run Windows XP, choose Start

Run. If you run Windows Vista,

simply choose Start.

A small Run dialog appears.


3. If you run Windows XP, type
cmd
in the Run dialog’s text field. If you

run Windows Vista, type
cmd
in the Start Search field. Then, in both

cases, press Enter.

The (by now

familiar) white
-
on
-
black command window appears.


4. In the command window, type the following line, and press Enter:

gem install rails
-
r
-
y

With this command, you tell your computer to use
gem


an installation
-

managing program for Ruby
add
-
ons. In par
ticular, you tell gem to

install Rails (though the command is
rails
, lowercase). The
-
r
part
of

the command tells gem to get the Rails program remotely (from the

Internet, that is). The
-
y
part of the command tells gem to install other

programs


programs
that your
computer needs in order for Rails to work properly


The gem installer has all kinds of nice features. To find out about these features,

open a command
window and type
gem help
,
gem help commands
, or

gem help examples
.


Installing Java
:


When you
create Ruby on Rails programs, it helps to work

inside an
integrated development
environment
(IDE). An IDE is like a text

editor, but smarter. An IDE organizes your code into projects,
runs your

code with a few mouse clicks, and displays the code’s output
in a nice panel.

In general, an IDE removes the programming grunt work and makes you more

productive.


Installing Net Beans:


This is the IDE we are going to use.


Visit:

http://www.netbeans.org/downloads/

Download and install net beans by clicking it and following instructions.


Installing MySQL
:


Rails is a framework for making Web pages communicate with databases. So

to work with Rails, you
need database software. If you already have database

software, y
ou can probably use that software
with Rails. Rails talks to all

kinds of databases, including Oracle, MySQL, DB2, Postgres, Firebird,
SQLServer,

and SQLite databases.


We will use
MySQL

as it

is free.


1. Visit
http://dev.mysql.com/downloads/mysql

2. Fin
d the link for downloading the Windows Essentials version of MySQL.


I
f you run Linux, a Mac OS, or some other non
-
Windows

operating system, you need to follow a slightly
different set of instructions.

The
http://dev.mysql.com/downloads/mysql
page has

down
loads for many
different operating environments, so scroll down

the page to find the download that’s right for your
system. You might

not see a download dubbed “Essentials,” but you can certainly find a

download for
your computer’s operating system.


3. Cl
ick the Download link.

Proceed with the download as you would with most other programs.

When the download is complete,
you double
-
click the downloaded file

to begin execution of the installation program.

When the installation finishes, the program asks whether you want to

begin configuring MySQL.


4. Make sure that the Configure MySQL check box is selected. Then click

Finish.

The MySQL Server Instance Configuration Wizard appears.


5. Click Next over and o
ver again to accept
most
of the defaults.