# Switching between projects?

**URL:** <https://www.ruby-forum.com/t/switching-between-projects/144273>\
**Category:** Rails\
**Created:** [July 28, 2008, 12:52am UTC](https://www.ruby-forum.com/t/switching-between-projects/144273 "2008-07-28T00:52:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pepa007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/779978/32.png) [@pepa007](https://www.ruby-forum.com/u/pepa007)\
**Post date:** [July 28, 2008, 12:52am UTC](https://www.ruby-forum.com/t/switching-between-projects/144273/1 "2008-07-28T00:52:38Z")

</div>

Hi,

sorry for newbie question:

how do I switch between projects on command line?

I know ‘rails projectA’ creates projectA. but if I have another  
projectB in another folder, how do I make this one active?

Thank you

---

<div class="post-metadata">

**Author:** ![pepa007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/779978/32.png) [@pepa007](https://www.ruby-forum.com/u/pepa007)\
**Post date:** [July 28, 2008, 1:30am UTC](https://www.ruby-forum.com/t/switching-between-projects/144273/2 "2008-07-28T01:30:03Z")

</div>

Just move to it !  
( cd …\projectB )  
( kill any servers like mongrel first )

---

<div class="post-metadata">

**Author:** ![pepa007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/779978/32.png) [@pepa007](https://www.ruby-forum.com/u/pepa007)\
**Post date:** [July 28, 2008, 3:42am UTC](https://www.ruby-forum.com/t/switching-between-projects/144273/3 "2008-07-28T03:42:46Z")

</div>

pepa007 wrote:

> Hi,
> 
> sorry for newbie question:
> 
> how do I switch between projects on command line?
> 
> I know ‘rails projectA’ creates projectA. but if I have another  
> projectB in another folder, how do I make this one active?
> 
> Thank you

By “active”, I’m assuming you mean you want to see it in the web  
browser. When you’re in a project folder and issue the script/server  
command, the default port used is 3000, so you can see the app at  
[http://localhost:3000](http://localhost:3000). You can run other apps on other ports by  
specifying the -p parameter when you call script/console. So you can do  
this:

~/rails\_app\_one/$ script/console

~/rails\_app\_two/$ script/console -p 3001

and you will have both apps running, one on port 3000 and the other on  
port 3001. As far as everything else, just being in the right directory  
determines which one is "active’.

Peace,  
Phillip

---

<div class="post-metadata">

**Author:** ![pepa007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/779978/32.png) [@pepa007](https://www.ruby-forum.com/u/pepa007)\
**Post date:** [July 28, 2008, 3:43am UTC](https://www.ruby-forum.com/t/switching-between-projects/144273/4 "2008-07-28T03:43:35Z")

</div>

Phillip K. wrote:

> pepa007 wrote:
> 
> ~/rails\_app\_one/$ script/console
> 
> ~/rails\_app\_two/$ script/console -p 3001

These two lines should refer to script/server, not script/console.

Sorry.
