Newby setup question

Is there a guide out there somewhere that tells you how to set up an
environment to start learning to code (and see the output)? I just don’t
get the command prompt/gems/ etc. stuff at all. The instructions are all
geared towards people who understand these basic concepts.

Thanks in advance.

Your question is a bit unclear, but for practicing Ruby, you usually
start with two tools:

One is to call irb from your shell, which gives you an interactive Ruby
environment. It’s great for trying out individual statements, because
you see the result immediately.

The other one is, like with any other programming language - this is not
specific to Ruby -, a nice text editor with syntax highlight, where you
write your programs and execute them.

What else are you missing?

Thanks Ronald

Whats missing is clear instructions on how to tie it all together. There
are instructions on what to to do but not how to do it.

For example, You say above “call irb from your shell”. I have no idea
what a shell is, or irb, or how to call it. To you, I am sure, this is
totally elementary, to me it’s a mystery.

Thanks

Edward

I think you should start working with a computer, before starting to
program. In particular, you should get familiar with one of the shells
(the most common ones are bash, zsh and ksh); while it is technically
possible to program without touching the shell (for example, by using an
IDE which lets you run from the inside), you will need working on the
comman line sooner or later.

You didn’t mention, which operating system you are using. This would be
a starting point to tell you how to invoke a shell.

Thanks Ronald

Win 8.1

Wow! Thanks Ronald for all of this.

As an alternative, I have downloaded a very simple Windows app called
Instant Ruby which gives you a basic text editor, an “execute” button,
and a screen showing you the output. You can also save.

Would it be a worthwhile approach to simply tackle some basic Ruby
coding in this environment and then if I want to go further do a proper
installation?

Edward Byrne wrote in post #1176298:

Thanks Ronald

Win 8.1

I haven’t ever really worked with Win 8.1, but I guess it’s not so
different from Win 7…

Win 8.1 comes with two shells: The infamous “DOS command line” (invoked
using “CMD”), and the PowerShell. I’ve never worked with the latter, so
I can’t comment on this.

While CMD would be enough to work, it’s really everything else than
powerful, and most programmers wouldn’t call it a shell, but if you are
happy with it, you could use it as a start. If you want to stick with
it, get familiar with it a bit, and alos with Batch programming.

BTW: You invoke “irb” in this shell by the command … irb.

There is an alternative, though:

When I have to work on Windows, I install Cygwin, which gives me plenty
of tools, including various shells. If you follow this route, be careful
that there are two Cygwin installers - one for 32 bit Windows and one
for 64 bit Windows.

Since Cygwin is so huge, only certain base packages are installed by
default. This includes bash, a good shell which is quite common. You
usually install first the base packages, then invoke setup again and
install additional packages.

For additional packages, I recommend you to install mintty (which is a
much better terminal console than the one which comes with Windows) and
chere (which allows you to invoke the shells directly from Windows
Explorer). Type

man mintty
man chere

after installation to learn how to use them.

As for the shell, I use zsh instead of bash, but this is a matter of
taste. Since you said that you are new to shells, you might try out fish
instead, which is a shell especially made for people who have not much
experience with this topic. I think it is quite good for beginners.

There is online documentation (man-pages) for the shells too, but the
docs is huge and meant to be a reference, not for learning. To learn how
to use a shell like bash or zsh, it’s better to google for a tutorial on
the Net.

BTW (and before this is going completely off-topic): If you decide to go
with Cygwin (and use bash/zsh/fish or whatever), you have the choice
between two Ruby implementations: The native one for Windows, and one
which is bundled with Cygwin. I wouldn’t install both, unless you are
experienced and know what you are doing. For learning, both are fine. My
recommendation would be to install the Cygwin Ruby (also available with
the Cygwin setup program) if you want to work in Cygwin shells, and
install the Windows Ruby if you want to stick with the native Windows
shells.

Right, thanks Ronald. Have downloaded Rails installer (comes with 2.2)
and am tackling installation. I will update you.

Edward Byrne wrote in post #1176354:

Would it be a worthwhile approach to simply tackle some basic Ruby
coding in this environment and then if I want to go further do a proper
installation?

This is a matter of taste, and I don’t think this can be answered
objectively. For playing around, such an integrated environment is
certainly suitable, but at least I would abandon such an environment
quickly. When I learn a new programming language, I very soon start to
write some small tools, which I actually use for myself, and this
typically means, tools which can be called from the command line (i.e.
from some shell), because this is usually simpler to program than some
GUI application. Therefore I always start from the command line
viewpoint.

For example, you will likely write small programs - and I mean
“programs” and not “Ruby functions”, which take parameters for doing
some work. For instance, you might want as an exercise a program, which
calculates, how often certain words occur in a file (a good beginner’s
exercise), and with such a program, you want to pass the name of the
file to be processed, and test it with various files (empty file, short
file, long file and so on). If you use an integrated environment for
programming, you usually have somewhere an option where you can place
the program parameters (the file name in our example), and this becomes
quickly tedious, when you switch between different files (compared to
the command line, where you use the shell history function to simply
recall a previous command).

But, as I said, it is a matter of taste, so start with whatever you feel
more at home.

BTW, if Ruby already comes bundled with Instant Ruby, make sure that you
get a fairly recent version of Ruby. I strongly recommend to use at
least 2.0.

Ronald

Edward Byrne wrote in post #1176359:

How do I install SQLite3 on the right path?

When I installed Rails, SQLite was already installed with it, but:

(1) From what you said before, You don’t know yet, how to program in
Ruby. Don’t you think you should keep your fingers away from Rails and
all this stuff, and learn the basics before?

(2) Isn’t Sqllite already available in your Gem list? You need to run
the gem command from your shell to find out.

(3) I can’t help you much with installation on Windows, because I don’t
use it. In any case, Rails specific questions should not be asked here,
but in the Rails forum.

How do I install SQLite3 on the right path?
Thx