Forum: Ruby really beginner question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
10a05060e7431bcca28e27dc1dc62f0c?d=identicon&s=25 rocksonchan (Guest)
on 2008-12-01 08:01
(Received via mailing list)
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?
Ec55f7b0e624fa6590dce6c007ba6e92?d=identicon&s=25 Trent Jones (dakarrally)
on 2008-12-01 12:30
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.
Cb6bbc826cd7d9238a2fae344958f7ec?d=identicon&s=25 Sandor Szücs (Guest)
on 2008-12-01 12:40
(Received via mailing list)
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
73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 Max Williams (max-williams)
on 2008-12-01 14:00
All the mac-owning rubyists i know use Textmate.   Stay away from IDEs:
a simple text editor and the command line is better.
289cf19aa581c445915c072bf45c5e25?d=identicon&s=25 Todd Benson (Guest)
on 2008-12-01 15:35
(Received via mailing list)
On Mon, Dec 1, 2008 at 6:54 AM, Max Williams
<toastkid.williams@gmail.com> 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
Ff9e18f0699bf079f1fc91c8d4506438?d=identicon&s=25 James Britt (Guest)
on 2008-12-01 16:03
(Received via mailing list)
Max Williams 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 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
84dc575c33a123789521d53cad0f62ae?d=identicon&s=25 Lloyd Linklater (lloyd)
on 2008-12-01 16:06
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.
73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 Max Williams (max-williams)
on 2008-12-01 16:13
Lloyd Linklater 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.
03394cad6c346c9cccef6390e8f7cd89?d=identicon&s=25 Andy Cooper (Guest)
on 2008-12-01 16:17
(Received via mailing list)
>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 Cooper.
10a05060e7431bcca28e27dc1dc62f0c?d=identicon&s=25 rocksonchan (Guest)
on 2008-12-01 18:10
(Received via mailing list)
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
Bbd6bac3e3bc74a803ff650fc37bcbcb?d=identicon&s=25 William Koch (Guest)
on 2009-01-15 20:02
(Received via mailing list)
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 <rocksonchan@gmail.com>
This topic is locked and can not be replied to.