Really beginner question


#1

hi all, as shows on the subject, it is a really really beginner
question.

i was trying to do the “hello world!” on my mac (v10.4 with ruby
1.8.2) in text editor,
but i could not save it with a .rb extension.

can someone please point out what i did wrong ?
thz in advance.

p.s. is there any simple free editor program for beginner that will
help me to learn ruby better?


#2

In response to a free editor program, I use SciTE, I believe there is an
open to install it when you install ruby, but I’m on a Windows machine,
not sure if SciTE is available for Mac…a quick google search (“Mac
coding editor”) brought up Smultron (http://tuppis.com/smultron/) which
is free and looks like it will do the job.

The documentation page on the Ruby website
(http://www.ruby-lang.org/en/documentation/) has numerous tutorials
which should be able to help you out with most of the basics. If you
have installed ruby correctly it should be as simple as saving the file
as MyFileName.rb
The file name doesnt have to be the same name as the class name or
anything, though it would be useful for larger programs that implement
various classes.


#3

Hi!
On 01.12.2008, at 07:54, rocksonchan wrote:

i was trying to do the “hello world!” on my mac (v10.4 with ruby
1.8.2) in text editor,
but i could not save it with a .rb extension.

If you use TextEdit then you should change the preferences so that
you use plaintext format instead of the Rich/RTF format (default?).

Also you can try google and test some other text editors. There are
really plenty of it.

can someone please point out what i did wrong ?

I think there’s some osx magic stuff that change the suffix of your
file to .txt or .rtf. Try to change the finder.app settings and you
will see it.

p.s. is there any simple free editor program for beginner that will
help me to learn ruby better?

No Texteditor will ever help you to learn a language.

hth, Sandor
Szücs


#4

All the mac-owning rubyists i know use Textmate. Stay away from IDEs:
a simple text editor and the command line is better.


#5

On Mon, Dec 1, 2008 at 6:54 AM, Max W.
removed_email_address@domain.invalid wrote:

All the mac-owning rubyists i know use Textmate. Stay away from IDEs:
a simple text editor and the command line is better.

I don’t use a Mac, but amen to that. My experience with IDE’s has
been horrible (think “tied down”), so I may be a bit biased.

To the OP, you might want to upgrade your Ruby to 1.8.6, and if you
are really ambitious, try vim for the text editor. In the long run,
you’ll be glad you learned it.

Saving your code on the Mac is probably best done using Textmate. Of
course, there are other options.

Todd


#6

rocksonchan wrote:

p.s. is there any simple free editor program for beginner that will
help me to learn ruby better?

Personally, I recommend that you go to http://www.sun.com/ and get
netbeans. You will be able to add ruby as one of the languages used and
it is really great AND free. It is not the only one but I highly
recommend it. Sun is actively supporting ruby these days and to very
good effect.


#7

Max W. wrote:

All the mac-owning rubyists i know use Textmate.

I know mac-owning rubyists who use Netbeans for it’s auto-completion
and refactoring tools.

Stay away from IDEs:
a simple text editor and the command line is better.

I know another Mac-owning Rubyist who swore by the use of an IDE because
of its ability to show and search project files.

I, a non-Mac owning Rubyist, prefer gvim and some shells, but there are
some IDEs (Netbeans, for example) that are extremely handy for various
tasks, including learning Ruby.


James B.

www.happycamperstudios.com - Wicked Cool Coding
www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
www.rubystuff.com - The Ruby Store for Ruby Stuff


#8

In response to a free editor program, I use SciTE, I believe there is
an
open to install it when you install ruby, but I’m on a Windows machine

I used SciTE for the longest time, until I started playing with textmate
on a mac, and then I was hooked. But since I am on windows myself I had
to go with E instead. Clone as it is, it is still in my opinion the
best money I have ever spent on programming, short of the cost to print
Why’s poignant guide.

Andy C…


#9

WOW~~ thanks for all the advices and suggestion.
i will try them out once i got home, and let you guys know the result~
thanks once again ~ i am sure i will post more question on this group
as a newbee~haha


#10

Lloyd L. wrote:

rocksonchan wrote:

p.s. is there any simple free editor program for beginner that will
help me to learn ruby better?

Personally, I recommend that you go to http://www.sun.com/ and get
netbeans. You will be able to add ruby as one of the languages used and
it is really great AND free. It is not the only one but I highly
recommend it. Sun is actively supporting ruby these days and to very
good effect.

Actually, when i did used to use an IDE i did use netbeans, which has
good ruby debugging tools.

The two approaches (IDEs vs text editor/command line) have their own
advantages and disadvantages. For example IDEs can be better for
debugging, but have a tendency to try to wrap lots of things that are
better done at the command line. If you need to do something new, it’s
much easier to follow a tutorial that says “paste this into your command
line” than it is to follow some instructions regarding IDE option menus,
config screens etc.

Maybe the best approach is to use an IDE but not be too dependent on it:
try to use the command line for as much as possible.


#11

Sorry for being so late on this, but I would like to recommend you
Smultron: http://tuppis.com/smultron/It’s a really simple editor, but it
has
syntax highlighting, and it’s free.

I’d like to recommend you to see this site too: http://osx.iusethis.com/
it
shows a lot of programs for mac, and how many people uses them:
http://osx.iusethis.com/app/textmate has 5009 fans and
http://osx.iusethis.com/app/smultron has 1974.

I’m still a beginner, and started with smultron, now I’m using textmate.

William Koch

2008/12/1 rocksonchan removed_email_address@domain.invalid