Totally lost in learning Ruby

This is my second attempt to understand Ruby. I completely read 1)
"Beginning Ruby- From Novice to Professional (which to me is a
completely waste of time), 2) The Pragmatic approach to Ruby (which is
incomplete)3)Ruby in 20 minutes, 4)other 15 to 20 minutes cute intro
programs 5) Shoes and now 6)The Book of Ruby by Huw Collingourne, which
seems like a bible without a compiler, which may be totally useless.

Is there anyone out there that could make my experience to Ruby
practical and meaningful? As noted previously, I am a school teacher
trying to create an education database software for administrators and
teachers which will hold educational institutions accountable for the
performance of their school district. My only programming experience is
the confusion I had trying to read and comprehend the above sources that
do not offer a stable compiler or the appropriate programs that will go
hand in hand with their book or resource for Ruby.

Is there a free compiler and other supporting software that I can use to
make my so far miserable learning Ruby experience worth a while? So far
I am still sold on the idea that Ruby is the programing language to
know, but at this moment I really need HELP.

Tk in advance,

Hilary

On Friday 21 January 2011 19:13:47 Hilary B. wrote:

teachers which will hold educational institutions accountable for the
Tk in advance,

Hilary

First, you don’t need a compiler to use ruby. Ruby is an interpreted
language,
which means that to execute a program written in ruby, you pass it to
the
source file (which is a plain text file) to the ruby interpreter which
will
take care of interpreting it and executing it. There’s no compilation
step
involved in this, which is the reason you found no reference to a
compiler.

As for books, you can try with the first edition of Programming Ruby,
which is
freely availlable online at
Programming Ruby: The Pragmatic Programmer's Guide.
It’s written for an old version of ruby, but it still is useful. There
are new
editions for new versions of ruby (edition 2 for ruby 1.8 and edition 3
for
ruby 1.9), but you have to buy them.

Regarding supporting software, that depends which operating system you
use.

If you’re on Windows, then there’s the RubyInstaller project
(http://rubyinstaller.org/) which provides the basic tool needed to work
with
ruby (I’m not completely sure about what it provides, as I don’t use
Windows
myself).

If you’re on Linux, then ruby is surely included in your distribution.

If you’re on another operating system, then I don’t know what your
options
are, but surely there’s someone else who knows.

I hope this helps

Stefano

I don’t mean to sound condescending, but if you’ve not programmed
before, perhaps you are underestimating the problem of jumping two
hurdles at once - learning to program, and learning the Ruby language.
Programming requires a paradigm-shift which, of course, is difficult to
explain to those who have not made it.

It sounds as if you have read a lot of books and got not much from them.
Why not try a different approach - try coding some simple programs for
yourself. If you are unable to access the Ruby interpreter, there are
websites that let you try it online (for example,http://tryruby.org/ ).

Go back to the book that you found least confusing and type out a couple
of examples for yourself. Try changing them. Code a simple program
from scratch – say, to ask for a series of numbers at the command
prompt and print their sum.

And of course come back here and ask all the basic questions you like.
It’s the basic questions that are the really deep ones. Good luck.

On Fri, Jan 21, 2011 at 11:13 AM, Hilary B.
[email protected] wrote:

Is there anyone out there that could make my experience to Ruby
practical and meaningful? As noted previously, I am a school teacher
trying to create an education database software for administrators and
teachers which will hold educational institutions accountable for the
performance of their school district. My only programming experience is
the confusion I had trying to read and comprehend the above sources that
do not offer a stable compiler or the appropriate programs that will go
hand in hand with their book or resource for Ruby.

Well, one hurdle at a time. First you need to learn to program, and
then you should tackle Ruby.

Fortunately, we can kill two birds with one stone:
http://pine.fm/LearnToProgram/

This will teach you how to program, and does it using Ruby. :slight_smile:

The next step would be reading up about databases, and GUI frameworks.
Either something like the wxWidget toolkit, which allows you to write
software that runs on a computer, or a web framework, like Rails, or
Sinatra (from your problem description, I’d go with a web framework,
if the database isn’t intended for just one school).

However, you won’t go fast, unless you can dedicate a good amount of
time to the task. If you spend an hour or two each day to learn
programming and then the technologies you might need, let’s call it a
month or two until you can tackle your original problem.

Is there a free compiler and other supporting software that I can use to
make my so far miserable learning Ruby experience worth a while? So far
I am still sold on the idea that Ruby is the programing language to
know, but at this moment I really need HELP.

Well, as others have pointed out: Ruby is not a compiled language.
You’ll need a text editor and/or an integrated development environment
to write Ruby programs (also called “scripts” from time to time).

Suggestions as to what to use as an editor/IDE depend highly on your
OS (Notepad is fine, but it lacks a couple of features that make life
easier). A few suggestions:
I like Notepad++ for “quick and dirty” jobs, it’s free and available
for Windows.
My preferred Ruby IDE is Netbeans, which is also free, and runs on
Java, so is available for all the major OSs.

And, once you are stuck, or have questions about Ruby/programming,
feel free to send another message to this forum. :slight_smile:


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.

“Hilary B.” [email protected] wrote in message
news:[email protected]

teachers which will hold educational institutions accountable for the
Tk in advance,

Hilary

Hello Hilary:

In addition to the suggestions provided by others you may also want to
look
at this Ruby Basic Tutorial
to
learn the Ruby language. It uses Linux so the way it describes running
Ruby
programs won’t work for Windows and some of the examples given are a
little
strange (e.g. the use of three ellipses for loops, which is often more
confusing than using Ruby’s two ellipse format, and the use of the
“length”
method like “for ss in 0…presidents.length” in loops which could just
be
replaced by “for ss in presidents”). These (and tons of other resource
you’ll find by typing “ruby tutorial” into Google) are also useful
Ruby Tutorial with Code Samples ,
Ruby Programming Tutorial - Digital Media Minute
.

I find Ruby a very easy (and enjoyable) language to learn (like Basic
was
many years ago) but it’s a big step between knowing a language and
knowing
how to design and build a database applications. If your goal is to
build
a database application to share with a number of people spread over a
large
geographical areas then you’ll eventually need to learn something about
database design, decide what database you want to use, and decide if you
want to create a desktop application (using something like wxRuby which
is
wxWidgets for Ruby) or a web application (using something like Ruby on
Rails, also called RoR or Rails) .

Desktop applications tend to be easier to write but harder to distribute
and
fix because you’ll need to copy them (or any fixes) to each computer
that
needs them. Web applications tend to be harder to write because you’ll
need more infrastructure (computers and software) and understanding of
programming specialties (i.e. security, multi-user environment design,
web
architecture) but are easier to distribute and fix because you’ll only
need
to provide folks with the location (i.e. a web address), user id and
password of your web application and can fix things in one spot, locally
on
your web server.

If your target ends up being a Windows desktop application, I find it
easier
to build desktop applications in tools like Embarcadero Delphi or
Microsoft
Visual Studio .NET and often suggest that clients with little
programming
experience use something like Microsoft Access because these tools have
integrated development-environments, database builders, GUI builders and
deployment tools that make things easier out-of-the-box. I suggest
this
because even though Ruby is a very nice languages (my favourite
actually),
the language is a small part of the overall picture when building a
complex
application. Unfortunately, Ruby is usually my last choice for desktop
projects because of the complexities of pulling together and
predictably
deploying all the pieces (i.e. database drivers, GUI, libraries). Ruby
also
presents challenges for speed, protection of intellectual property and
data
privacy. I recommend you dig deeper on these topics and decide for
yourself. I just wanted to warn you before you got too deep then
frustrated
and blamed Ruby for your pain when the pain is probably related to many
other things. If your target ends up being a web application then Ruby
on
Rails is a good choice (even through, for similar reasons, I’ve found
Embarcadero Delphi Intraweb better for the web applications I’ve needed
to
build).

If you decide to use Ruby to develop your database application you
should
consider purchasing a robust code editor like JetBrains RubyMine
(RubyMine: The Ruby on Rails IDE by JetBrains ) which can help you be more productive
(especailly for coding error identifcation and debugging) when writing
either Ruby or Ruby on Rails applications.

I learned Ruby with the book “Programming Ruby” and Ruby-on-Rails with
the
book “Agile Web D. with Rails”. Both are authored by Dave
Thomas
and published by The Programmatic Programmers.

Michael

“Michael B.” [email protected] wrote in message
news:[email protected]

I learned Ruby with the book “Programming Ruby” and Ruby-on-Rails with the
book “Agile Web D. with Rails”. Both are authored by Dave T.
and published by The Programmatic Programmers.

Michael

Oops… I meant to say “The Pragmatic Programmers” at the end of that
last
sentences. Darn spell checking out-smarted me. Their stuff is
available
here http://pragprog.com/ .

Michael

Hilary B. wrote in post #976477:

Is there anyone out there that could make my experience to Ruby
practical and meaningful? As noted previously, I am a school teacher
trying to create an education database software for administrators and
teachers which will hold educational institutions accountable for the
performance of their school district. My only programming experience is
the confusion I had trying to read and comprehend the above sources that
do not offer a stable compiler or the appropriate programs that will go
hand in hand with their book or resource for Ruby.

A district-wide database and interface is not a trivial project. Coding
it from scratch is a challenge for a seasoned developer in any language.

Why do want to do it in Ruby and why are you doing it from scratch?

Jose

Jose Hales-Garcia
UCLA Department of Statistics

On Sat, Jan 22, 2011 at 10:39 AM, Jose Hales-Garcia [email protected]
wrote:

A district-wide database and interface is not a trivial project. Coding
Posted via http://www.ruby-forum.com/.

Actually why is this being done in-house as opposed to outsourcing it
from a professional is a better question.

If you have a little .NET experience you could try using IronRuby. It
could
combine the familiarity of .NET way of building applications (especially
Windows Forms) with the Ruby language specifics. You are familiar with
Java
you could try JRuby and build a Swing application using Ruby.

I recommnd learn for the beginning and study every sintax before
another,
and pratice. :smiley: good luck!

2011/1/22 Stu [email protected]

Stefano C. wrote in post #976481:

On Friday 21 January 2011 19:13:47 Hilary B. wrote:

teachers which will hold educational institutions accountable for the
Tk in advance,

Hilary

First, you don’t need a compiler to use ruby. Ruby is an interpreted
language,
which means that to execute a program written in ruby, you pass it to
the
source file (which is a plain text file) to the ruby interpreter which
will
take care of interpreting it and executing it. There’s no compilation
step
involved in this, which is the reason you found no reference to a
compiler.

As for books, you can try with the first edition of Programming Ruby,
which is
freely availlable online at
Programming Ruby: The Pragmatic Programmer's Guide.
It’s written for an old version of ruby, but it still is useful. There
are new
editions for new versions of ruby (edition 2 for ruby 1.8 and edition 3
for
ruby 1.9), but you have to buy them.

Regarding supporting software, that depends which operating system you
use.

If you’re on Windows, then there’s the RubyInstaller project
(http://rubyinstaller.org/) which provides the basic tool needed to work
with
ruby (I’m not completely sure about what it provides, as I don’t use
Windows
myself).

If you’re on Linux, then ruby is surely included in your distribution.

If you’re on another operating system, then I don’t know what your
options
are, but surely there’s someone else who knows.

I hope this helps

Stefano

Hi Stefano,
Thanks for such speedy response. The Rubi community is really
impressive. I was under the impression that after having some programing
language skilss and with some training I would be able to put together a

of applications and build a program computer program. I thought that

just like how individuals could use some of Apple’s apps, put them
together then build a game, I believed that eventually this could be
done with Ruby and its supportive/compatible applications.

Now facing this reality, would it help if I used Linux instead of
Windows 7?

Shadowfirebird wrote in post #976488:

I don’t mean to sound condescending, but if you’ve not programmed
before, perhaps you are underestimating the problem of jumping two
hurdles at once - learning to program, and learning the Ruby language.
Programming requires a paradigm-shift which, of course, is difficult to
explain to those who have not made it.

It sounds as if you have read a lot of books and got not much from them.
Why not try a different approach - try coding some simple programs for
yourself. If you are unable to access the Ruby interpreter, there are
websites that let you try it online (for example,http://tryruby.org/ ).

Go back to the book that you found least confusing and type out a couple
of examples for yourself. Try changing them. Code a simple program
from scratch – say, to ask for a series of numbers at the command
prompt and print their sum.

And of course come back here and ask all the basic questions you like.
It’s the basic questions that are the really deep ones. Good luck.

Shadowfirebird,
Thank you for the advice.

Hi Stefano,
Thanks for such speedy response. The Rubi community is really
impressive. I was under the impression that after having some programing
language skilss and with some training I would be able to put together a

of applications and build a program computer program. I thought that

just like how individuals could use some of Apple’s apps, put them
together then build a game, I believed that eventually this could be
done with Ruby and its supportive/compatible applications.

Now facing this reality, would it help if I used Linux instead of
Windows 7?

Shadowfirebird,
Thank you for the advice.

On Saturday, January 22, 2011 10:44:56 pm Hilary B. wrote:

I was under the impression that after having some programing
language skilss and with some training I would be able to put together a

of applications and build a program computer program. I thought that

just like how individuals could use some of Apple’s apps, put them
together then build a game, I believed that eventually this could be
done with Ruby and its supportive/compatible applications.

I’m not sure quite what you mean here.

If you mean create a brand-new app from scratch using something like
Apple’s
Xcode tools, and then having a standalone app (without forcing people to
install Ruby), there are options for that. I haven’t ever had to do
this, but
the project that looks the coolest for this purpose is Rawr
(http://rawr.rubyforge.org/).

If you mean take several existing apps and mash them together into a new
app,
that really depends which apps you’re talking about. It could be a five
minute
job of writing the appropriate glue code, essentially snapping stuff
together
like legos, or it could be a truly impossible task, like trying to
attach an
aircraft carrier to a 747 and make a useful vehicle out of it when you
don’t
have access to the blueprints of either.

For what you described:

“I am a school teacher trying to create an education database software
for
administrators and teachers which will hold educational institutions
accountable for the performance of their school district.”

I’m guessing you mean the former – you’re wanting to build something
from
scratch, and you were just wanting to know how to actually get an app
out of
it, right?

I’d also imagine that this sort of thing would make more sense as a web
app.
The advantages of that approach would be that you don’t have to create
an
installer and make sure it installs and runs properly on every single
person’s
computer, you just need to make sure they have a decent web browser.
Basically, you’d get to install whatever OS and software you want on
whatever
server(s) it runs on, and to everyone else, it’s just a website.

The main disadvantage is that it would be a lot more of a learning
curve –
you’d want to know at least HTML and CSS, if not also HTTP (easy) and
JavaScript, in addition to Ruby.

Now facing this reality, would it help if I used Linux instead of
Windows 7?

Maybe.

Ruby definitely seems designed to run on a Unix of some sort, so if you
want
to make the Ruby part easy on yourself, some sort of Linux would help.
So
would BSD, OS X, even Solaris.

But learning an entirely new OS at the same time as you learn to program
sounds like a daunting task.

David M. wrote in post #976879:

On Saturday, January 22, 2011 10:44:56 pm Hilary B. wrote:

I was under the impression that after having some programing
language skilss and with some training I would be able to put together a

of applications and build a program computer program. I thought that

just like how individuals could use some of Apple’s apps, put them
together then build a game, I believed that eventually this could be
done with Ruby and its supportive/compatible applications.

I’m not sure quite what you mean here.

If you mean create a brand-new app from scratch using something like
Apple’s
Xcode tools, and then having a standalone app (without forcing people to
install Ruby), there are options for that. I haven’t ever had to do
this, but
the project that looks the coolest for this purpose is Rawr
(http://rawr.rubyforge.org/).

If you mean take several existing apps and mash them together into a new
app,
that really depends which apps you’re talking about. It could be a five
minute
job of writing the appropriate glue code, essentially snapping stuff
together
like legos, or it could be a truly impossible task, like trying to
attach an
aircraft carrier to a 747 and make a useful vehicle out of it when you
don’t
have access to the blueprints of either.

For what you described:

“I am a school teacher trying to create an education database software
for
administrators and teachers which will hold educational institutions
accountable for the performance of their school district.”

I’m guessing you mean the former – you’re wanting to build something
from
scratch, and you were just wanting to know how to actually get an app
out of
it, right?

I’d also imagine that this sort of thing would make more sense as a web
app.
The advantages of that approach would be that you don’t have to create
an
installer and make sure it installs and runs properly on every single
person’s
computer, you just need to make sure they have a decent web browser.
Basically, you’d get to install whatever OS and software you want on
whatever
server(s) it runs on, and to everyone else, it’s just a website.

The main disadvantage is that it would be a lot more of a learning
curve –
you’d want to know at least HTML and CSS, if not also HTTP (easy) and
JavaScript, in addition to Ruby.

Now facing this reality, would it help if I used Linux instead of
Windows 7?

Maybe.

Ruby definitely seems designed to run on a Unix of some sort, so if you
want
to make the Ruby part easy on yourself, some sort of Linux would help.
So
would BSD, OS X, even Solaris.

But learning an entirely new OS at the same time as you learn to program
sounds like a daunting task.

Hi David,
Thanks a $llion for responding. Based on your response, where do I
start? Is there a specific HTML guide?. What is CSS and which one or
version should I use? And I guess the same applies to HTTP and
JavaScript. To a novice like me,I am still trying to piece together an
approach to learning how to program using and becoming a part of the
Open Source community. The difficulty is that the kind individuals like
yourself, who have answered my call for help have been tossing at me so
many programs that end-up adding to the problem. Therefore I am going to
take all the suggestions, place them in a learning sequential pattern
and ask you again for your advice. At this moment the web option seems
to be the closest answer to what I have been searching for. Getting
there is the problem. I am willing to spends the grueling time learning
it.

On Sat, Jan 22, 2011 at 10:44 PM, Hilary B.
[email protected]wrote:

Now facing this reality, would it help if I used Linux instead of
Windows 7?

I think you should not do this. It is tempting to think “if only I did
this,
or had that, everything would be so much easier”. This is why I own so
many
books :stuck_out_tongue:

Linux is a whole topic of its own. I suppose there might be some rewards
to
using it, but certainly not enough to warrant switching, for someone in
your
situation. IMO, Linux suffers serious usability issues, which is why I
use a
Mac. I expect switching would just be a hindrance.

Windows will be fine, if your gems are just not working (make sure you
have
the devkit), or you have to really beat your head against the wall to
get
things to install and play nicely, then maybe you will have a reason to
switch, but I never had any issues like that when I used Windows, and
there
are a number of people really putting a lot of work in to make the
Windows
environment nice to use Ruby with.

So far, it sounds like your issue is that you are not getting the
information out of the books that they were hoping you would get out of
them. That is not an environment problem, so I think you should stick
with
Windows.

I think the problem is the way you are trying to get information out of
the
books you have / the way the books are guiding you to get information
out.
The Revolutionist’s Handbook has a maxim that I have found to be true in
my
own life: “Activity is the only road to knowledge”. When you go to learn
from these books, do you sit down and read them, try to piece the
information into some sort of cohesive bit of information, and then move
on
to the next thing? Or do you read them, sit down and try to use them in
a
program, see if they work the way they are described, see how you can
take
them and combine them in a new way to do something interesting to you? I
suspect you have written extremely few programs by your confusion about
the
compiler. That is not a problem in itself, but it will prevent you from
learning. I believe to “get it”, you must ground the theory in some sort
of
application that you comprehend on a more fundamental level. And playing
with the material out of your own creativity, writing your own code,
fabricating your own solution out of the building blocks the books give
you,
I think, is the best way to translate the theory of Ruby programming
into
something you internally understand.

I hope you don’t find that to be offensive, I am just trying to express
the
realization I’ve had to face in my own life, that there are good and bad
ways of learning. When you are using the good ways, you will amaze
yourself
by how much you can pick up so quickly, and when you are using the bad
ways,
you will make almost no progress, and be very frustrated by how even
things
you know are simple turn out to be complicated.

Descriptions, written in English, are just abstractions for the actual,
concrete behaviour of the thing. They have their place, and can be a
wonderful way to communicate, but you must first understand how the
abstraction maps to the reality. You first have to have the foundations
of a
mental model to map the new knowledge to. And that, I think, comes from
doing and playing.

On Sun, Jan 23, 2011 at 3:07 PM, Hilary B. [email protected]
wrote:

Thanks a $llion for responding. Based on your response, where do I
start? Is there a specific HTML guide?. What is CSS and which one or
version should I use? And I guess the same applies to HTTP and
JavaScript.

There’s dozens of HTML, CSS, and JavaScript guides out there, but a
good starting point to learn HTML, CSS and JavaScript is
w3schools.com.

Keep in mind, that those three are different, but related, technologies:

  • HTML describes a site.
  • CSS makes a site pretty.
  • JavaScript manipulates a site.

As for versions of those: Take a look at w3schools.com. What you can
learn there will be supported by pretty much any recent browser (HTML
5 and CSS 3.0 aren’t wildly deployed yet, and still in flux, though
the current generation of browsers is getting better at them: IE9,
Firefox 4, Chrome dev-channel).

You don’t really need to learn HTTP (fortunately): If you decide on a
web-based solution, your webserver will take care of that. At most,
deal with error codes, of which you need to know 3:
404: Site not found.
500: Internal Server Error (a catch all, meaning that something in
your webserver went wrong).
200: The client request could be processed.

Those 3 are important to troubleshoot an application.

Also: Web servers, database servers, HTTP stuff etc. is more the
domain of a system administrator.

To a novice like me,I am still trying to piece together an
approach to learning how to program using and becoming a part of the
Open Source community. The difficulty is that the kind individuals like
yourself, who have answered my call for help have been tossing at me so
many programs that end-up adding to the problem. Therefore I am going to
take all the suggestions, place them in a learning sequential pattern
and ask you again for your advice.

Well, you need two tools to develop Ruby applications: A texteditor,
and Ruby itself. Everything else is gravy. :wink:

For web stuff, it helps to have a number of browsers installed, to see
if your markup code and JavaScript work as you think they should.
However, if you can find a web designer, they’ll happily do that for
you, or grab a template for HTML and CSS off of a website, like
oswd.org or opensourcetemplates.org .

Of course, you’ll want to look out for libraries that do what you want
to do, without you having to deal with the problem yourself, since
that means you can focus on your own application, rather than having
to deal with Yet Another Problem (we usually call that “yak shaving”:
it’s something you have to do, but isn’t really getting you towards
solving the problem).

That can be database wrappers (means to interface with a database, and
doing so in a Ruby-ish syntax), or Markdown to format text without
having to deal with the gritty HTML, and so on.

Searching the web for “ Ruby library” usually helps, as
does taking a look at http://ruby-toolbox.com/

At this moment the web option seems
to be the closest answer to what I have been searching for. Getting
there is the problem. I am willing to spends the grueling time learning
it.

A good choice for that is, probably, Rails. You can easily install
Ruby and Rails with the RailsInstaller (railsinstaller.org), which
bundles all you need in one package, and you don’t really need a web
server, or anything else to run a Rails app in development mode (which
is the default).

Rails has the other benefit that there are a lot of tutorials and
howtos to be found, and the Rails community one forum over can be
helpful, too.

Another very good resource is http://railscasts.com/, and I’ve heard
only good things about PeepCode.com’s webcasts (which are pay for, but
everybody is raving about them).

While all of this seems like a lot, you can divide this with ease into
several steps:

  • Learn Ruby and Rails (or another web framework, like Sinatra)
  • Pick up the necessities of HTML, CSS, and JavaScript
  • Learn about application security (this is very, very important on
    the internet!)
  • Learn about deployment options for Rails (or the web framework you
    chose)

    Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.

Hilary B. wrote in post #976477:

This is my second attempt to understand Ruby.

What happened the first time - did you give up or try something else?

My only programming experience is
the confusion I had trying to read and comprehend the above sources

Have you never used another programming system? Why did you choose Ruby?

Is this application for you, a closed group of users or do you want to
market it?

Hi David,
Thanks a $llion for responding. Based on your response, where do I
start? Is there a specific HTML guide?. What is CSS and which one or
version should I use? And I guess the same applies to HTTP and
JavaScript. To a novice like me,I am still trying to piece together an
approach to learning how to program using and becoming a part of the
Open Source community. The difficulty is that the kind individuals like
yourself, who have answered my call for help have been tossing at me so
many programs that end-up adding to the problem. Therefore I am going to
take all the suggestions, place them in a learning sequential pattern
and ask you again for your advice. At this moment the web option seems
to be the closest answer to what I have been searching for. Getting
there is the problem. I am willing to spends the grueling time learning
it.