tags:

views:

329

answers:

6

Recognizing this as a similar question...

So this link shows how to install Ruby on Rails on Mac, and then using it w/ XCode.

(1) Is there an interpreter like Python's IDLE for Ruby? If so, where to get it.

(2) How do I run Ruby w/o using an interpreter?

(3) How do I get started using Ruby for web apps - does this require me to learn PHP, also?

Thanks in advance, SO ppl...

A: 

(1) I don't use one, and I don't know of any (but then, I don't really know what IDLE is anyway). Textmate works well for me.

(2) You can't run Ruby without an interpreter.

(3) No, you don't need to learn PHP. You should try out a Ruby web-framework, like Ruby on Rails or Merb (which are being merged).

dylanfm
Textmate does have good support for various Ruby and Ruby on Rails functions, such as testing.
thetacom
A: 
  1. I don't think it's quite what you're looking for, but you can use IRB(Interactive Ruby Shell) to experiment with ruby code.
  2. Ruby is an interpreted language hence the required use of an interpreter.
  3. Using Ruby for a web application doesn't require you to know PHP, but it would help to have a good understanding of the concept of server side languages. If you are looking for a good place to start with Ruby web apps, google for Ruby on Rails or Merb.
thetacom
+5  A: 
  1. I think you are looking for the irb command (Interactive Ruby Shell), which is similar to IDLE in some ways. You can also use Textmate and Command+R to run code as you go, which I do a lot when prototyping.

  2. Ruby is by definition an interpreted language. We don't yet have the benefits of running Ruby within a VM with bytecode (except for JRuby), but keep an eye on the rubinius project (http://rubini.us), that is going to totally change things for Ruby very soon.

  3. Ruby and PHP have no correlation. You are going to want to look into Ruby on Rails. Rails is a fantastic full-stack framework that can be very simply deployed using Apache and Passenger (http://www.modrails.com). I wouldn't worry about Merb just yet as Rails and Merb have both announced they will be integrating their codebases here in 2009.

To be honest, the easiest way to get going with Ruby/Rails is using something like textmate. I also highly recommend checking out this site for tutorials/screencasts: http://www.railscasts.com

Derek P.
A: 

In addition to IRB (Interactive Ruby Shell) mentioned by @thetacom, there are some online interpreters:

CMS
A: 

If by (2) you mean how do you interact with Ruby without saving your code into a file then running that through the interpreter, then you can use the "irb" program which comes with Ruby. It lets you type Ruby statements in a console and see the output when you hit return.

If you're on Windows irb becomes a Start menu option when you install Ruby. On Linux or a Mac it's a command line application.

Ethan
A: 

If you're attempting to learn Ruby on Rails, you may get discouraged following the many outdated tutorials on the web. Glen Gillen wrote an article recently listing many "still relevant" examples. It was posted this morning on the Ruby subreddit.

Ruby on Rails is a web framework for the Ruby programming language. That said, I'd recommend getting a good understanding of Ruby before diving into Ruby on Rails. Rails uses just enough Ruby subtleties to throw off a prospective Rails developer. A simple text editor is enough for writing Ruby/Rails. I like Gedit for Linux and Notepad++ on Windows. If you really want to use an IDE, NetBeans has all of the standard features including code completion (which is hard to find in an IDE for Ruby) and works on all platforms.

Good luck!