# Rails Newbie : Basic Question

**URL:** <https://www.ruby-forum.com/t/rails-newbie-basic-question/105662>\
**Category:** Rails\
**Created:** [June 1, 2007, 5:02am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662 "2007-06-01T05:02:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![riverdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@riverdog](https://www.ruby-forum.com/u/riverdog)\
**Post date:** [June 1, 2007, 5:02am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662/1 "2007-06-01T05:02:44Z")

</div>

I’ve been reading and reading about rails and I’m eager to get started

- but I’ve got a question that no literature seems to address.

Every rails book tells you how easy it is to start a sample rails app  
by starting up the server and goign to localhost:3000.

BUT -  
what if I’m working from a client?

As a Dreamweaver user, I’m used ot working on the client - uploading  
to the server (Apache on Linux) and then going to a browser to see my  
result. However, every rails book I see tells you to go to localhost:  
3000. I’m not on the localhost. I’m on the client.

It concerns me because if we have several developers working on one  
rails app, they will not be able to work on localhost simultaneously.  
So I would think that you would be able to program remotely from a  
client - but then, I’m bothered by the fact that not a single book  
I’ve come across tells you to go to /ipaddress:3000 - they all say go  
to localhost:3000.

I can see myself loading a temporary server on my client and then  
using capistrano to deploy it to my server, but this seems very clumsy  
for a framework that touts simplicity.

Can anybody help with this?

---

<div class="post-metadata">

**Author:** ![riverdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@riverdog](https://www.ruby-forum.com/u/riverdog)\
**Post date:** [June 1, 2007, 5:16am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662/2 "2007-06-01T05:16:59Z")

</div>

riverdog wrote:

> Can anybody help with this?

Sure. You just go to theclient:3000, i.e., you add the port to the URL.

[http://www.someclent.com:3000](http://www.someclent.com:3000)

You have to make sure that whatever firewalls are in between will pass  
that port through.

–Al Evans

---

<div class="post-metadata">

**Author:** ![riverdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@riverdog](https://www.ruby-forum.com/u/riverdog)\
**Post date:** [June 1, 2007, 5:17am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662/3 "2007-06-01T05:17:45Z")

</div>

technically you still can. Just substitute localhost witht the IP of  
the rails server.

The better way is to setup a subversion repository where your  
developers can check out a local copy (stops people breaking each  
others code) and all run their own localhosts.

---

<div class="post-metadata">

**Author:** ![riverdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@riverdog](https://www.ruby-forum.com/u/riverdog)\
**Post date:** [June 1, 2007, 5:39am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662/4 "2007-06-01T05:39:46Z")

</div>

It sounds as though your mis understading what localhost actually is.  
localhost is essentially what ever computer you are working on. So if  
i visit localhost here I see a server running on my computer, if you  
type it you will see yours.

Basicly everyone runs a developement server on their own computer,  
once it’s debugged etc then you upload it to the real server.

---

<div class="post-metadata">

**Author:** ![riverdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@riverdog](https://www.ruby-forum.com/u/riverdog)\
**Post date:** [June 1, 2007, 5:43am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662/5 "2007-06-01T05:43:46Z")

</div>

Thanks flukus.

I guess I’m confused because Rails has a development-test-production  
convention, and it also has versioning built in. So why would we need  
to check out local copies - if we would have versions on the server  
that each developer has made changes to and can roll back?

We currently program traditional software and we have a repository  
where we have to check files out and lock them. My first reading of  
Rails is that it has versioning built-it - and that since it is a web-  
based framework - the updates are live. It makes no sense to me to  
have to download and upload versions of the app to each developers  
client. It would make much more sense to me to give developers the  
power to develop from the client and upload to the server to a  
development version, which can then be tested before going to  
production.  
-Rick

---

<div class="post-metadata">

**Author:** ![riverdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@riverdog](https://www.ruby-forum.com/u/riverdog)\
**Post date:** [June 1, 2007, 5:33am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662/6 "2007-06-01T05:33:46Z")

</div>

Thanks Al,

I’ll check the firewall to help with this.  
But I guess the bigger question is - it appears to me from reading the  
guides that the actual programming has to be done on the server. Is  
this true or am I reading this wrong? Dreamweaver lets me code on the  
client - upload to the server and watch it run. It appears that rails  
needs to be worked on in the server environment. I hope I’m wrong.

-Rick

---

<div class="post-metadata">

**Author:** ![riverdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@riverdog](https://www.ruby-forum.com/u/riverdog)\
**Post date:** [June 1, 2007, 5:49am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662/7 "2007-06-01T05:49:47Z")

</div>

WebBrick (which comes with Rails) or Mongrel (which you can get from  
[http://mongrel.rubyforge.org/](http://mongrel.rubyforge.org/)) are simple, small webservers that you  
can run on your client if you don’t have another web server. They  
both listens for requests on port 3000. Most tutorials will teach you  
how to launch WebBrick and that’s why they are directing you to use  
“localhost:3000”.

If you have a Mac, you also have Apache installed. It, like most web  
servers, listens on port 80.

1. Develop on your client, using a local web server.
2. Then upload the files to the hosted Linux/Apache web server.

HTH,  
Kevin S.

---

<div class="post-metadata">

**Author:** ![riverdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@riverdog](https://www.ruby-forum.com/u/riverdog)\
**Post date:** [June 1, 2007, 5:44am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662/8 "2007-06-01T05:44:46Z")

</div>

On Jun 1, 1:32 pm, riverdog [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks Al,
> 
> I’ll check the firewall to help with this.  
> But I guess the bigger question is - it appears to me from reading the  
> guides that the actual programming has to be done on the server. Is  
> this true or am I reading this wrong? Dreamweaver lets me code on the  
> client - upload to the server and watch it run. It appears that rails  
> needs to be worked on in the server environment. I hope I’m wrong.
> 
> -Rick

Hi Rick,

Most rails developers use a local development environment, and a  
remote production server.

So while developing, they run mysql/apache/rails on their own computer  
(client). There’s no need to keep uploading, all you need to do is  
refresh the page to see your changes. You can also develop without  
network or internet access.

If you’re working in a team, each developer runs their own local  
development environment and source control is used to keep everything  
in check. Subversion is the most common source control tool used I  
think.

Once you have a version of your app ready for production, only then do  
you upload it to the remote server.

It’s a slightly different way of working to what it appears you’re  
used to, but it does work well once you get your head around the  
differences. I have worked the Dreamweaver way before, and I much  
prefer the Rails way to doing things (although this method of  
development certainly isn’t unique to Rails).

---

<div class="post-metadata">

**Author:** ![riverdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@riverdog](https://www.ruby-forum.com/u/riverdog)\
**Post date:** [June 1, 2007, 5:52am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662/9 "2007-06-01T05:52:47Z")

</div>

Okay.

I think I get it. Although I’m a bit disappointed.

I don’t see why a team cannot leverage the production server better by  
doing the versioning on the server instead each developer having a  
copy of the entire app & server on their computer. That seems very  
inefficient.

When I first started conceptualizing RAILS, I got really excited  
because of the ability to leverage the server - having each developer  
access the server code - update it on the development folder - sending  
it to the test folder and once it passes - on to production. It seems  
very un-web-like to have each developer code and test on his own  
computer and then upload to the server.

Perhaps the framework could be extended in the future to help teams  
work together on the server instead of doing uploads.

Thanks for your input.  
-R

---

<div class="post-metadata">

**Author:** ![riverdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@riverdog](https://www.ruby-forum.com/u/riverdog)\
**Post date:** [June 1, 2007, 6:04am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662/10 "2007-06-01T06:04:48Z")

</div>

Kevin, flukus and Al,

Thanks. You guys are great and you answered my newbie question! I  
will jump in and go for it on my own computer. I already have  
everything on my own computer to do that - I was just not sure if that  
was the way it was supposed to work.

We currently use StarTeam as a repository or (versioning) tool for our  
Delphi software development with all our developers able to access and  
run the TIP version from our server. Subversion will probably work in  
a similar way.

Thanks again,  
-Rick

---

<div class="post-metadata">

**Author:** ![riverdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@riverdog](https://www.ruby-forum.com/u/riverdog)\
**Post date:** [June 1, 2007, 5:51am UTC](https://www.ruby-forum.com/t/rails-newbie-basic-question/105662/11 "2007-06-01T05:51:47Z")

</div>

On Jun 1, 1:43 pm, riverdog [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks flukus.
> 
> I guess I’m confused because Rails has a development-test-production  
> convention, and it also has versioning built in. So why would we need  
> to check out local copies - if we would have versions on the server  
> that each developer has made changes to and can roll back?

Rails has absolutely no versioning built in. The development-test-  
production stuff is whats known as staging.

Lets say version 1 is on the server and version 2 is on your computer.  
If you upload version 2 then you will have version 2 on the server,  
except it will use the production settings instead of the development  
ones.
