really beginner question

R

rocksonchan

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?
 
T

Trent Jones

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.
 
S

Sandor Szücs

Hi!
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=FCcs
--
 
M

Max Williams

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

Todd Benson

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
 
J

James Britt

Max said:
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 Britt

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
 
L

Lloyd Linklater

rocksonchan said:
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.
 
M

Max Williams

Lloyd said:
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.
 
W

William Koch

[Note: parts of this message were removed to make it a legal post.]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top