views:

296

answers:

3

I'm a complete apple newbie coming from a LAMP+windows setup trying to figure out how ruby and apple works.

So I just executed "gem server" and i have this server running on localhost:8808 now, great -- it works.

BUT Anyone know where the heck is my root directory ie. the equivalent of htdocs? I can't find it, damnit.

cheers...

A: 

I think you want /Library/Ruby/Gems/1.8 and then doc/ or gems/.

Daniel Lucraft
+1  A: 

I think you are mixing things up. I assume from your question that you think gem server is a webserver like apache/IIS.

Gem server is a stand alone web frontend to display all the locally installed gems and documentation.

Ruby is a general-purpose programming language, if you want to do web stuff in ruby (you mentioned LAMP). I suggest you check out the following web frameworks:

Michel de Graaf
oh thanks. i thought gem server was a full "apache" type server.
+1  A: 

If you are going to use Ruby for Web development, the most widely-used framework for that purpose is Ruby on Rails (usually referred to as just "Rails"). It is distributed as a Ruby "gem."

  1. Install Ruby (you already have that).
  2. Install RubyGems (sounds like you're good there too).
  3. Install the Rails gem...

On your OS X command line (use the OS X application called "Terminal"):

$ sudo gem install rails

Now you're ready to build your superior FaceBook clone.

$ rails enhancedfacebook

You were asking about Web servers. cd into your project dir...

$ cd enhancedfacebook

And start the Web server that comes with Rails...

$ script/server 
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server

Now your application is running on your local machine here:

http://localhost:3000

For the production server, you'd use a different, more robust setup (probably Apache with mod_rails, AKA "Passenger"), but for viewing your app as you work on it, this is what you'd use.

Ethan