# How to change project location?

**URL:** <https://www.ruby-forum.com/t/how-to-change-project-location/58370>\
**Category:** Rails\
**Created:** [April 20, 2006, 11:39pm UTC](https://www.ruby-forum.com/t/how-to-change-project-location/58370 "2006-04-20T23:39:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![blair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@blair](https://www.ruby-forum.com/u/blair)\
**Post date:** [April 20, 2006, 11:39pm UTC](https://www.ruby-forum.com/t/how-to-change-project-location/58370/1 "2006-04-20T23:39:57Z")

</div>

I moved a project from /var/www/mypro to /home/user1/mypro … what do I  
have to change in config?

The server does not start anymore.

Thank you - Eric

---

<div class="post-metadata">

**Author:** ![blair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@blair](https://www.ruby-forum.com/u/blair)\
**Post date:** [April 20, 2006, 11:44pm UTC](https://www.ruby-forum.com/t/how-to-change-project-location/58370/2 "2006-04-20T23:44:00Z")

</div>

Eric B. wrote:

> I moved a project from /var/www/mypro to /home/user1/mypro … what do I  
> have to change in config?
> 
> The server does not start anymore.
> 
> Thank you - Eric

Which server? Do you get an error message? Any logs that might help us  
understand…

---

<div class="post-metadata">

**Author:** ![blair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@blair](https://www.ruby-forum.com/u/blair)\
**Post date:** [April 21, 2006, 9:34am UTC](https://www.ruby-forum.com/t/how-to-change-project-location/58370/3 "2006-04-21T09:34:36Z")

</div>

> > > > > “Eric” == Eric B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> I moved a project from /var/www/mypro to /home/user1/mypro … what do I  
> have to change in config?

## Please read this and then post your question again: [Error](http://cdybedahl.livejournal.com/377764.html)

```
	     Calle D. <removed_email_address@domain.invalid>
	 http://www.livejournal.com/users/cdybedahl/
  Truth is stranger than fiction, because fiction has to make sense.

```

---

<div class="post-metadata">

**Author:** ![blair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@blair](https://www.ruby-forum.com/u/blair)\
**Post date:** [April 21, 2006, 12:25pm UTC](https://www.ruby-forum.com/t/how-to-change-project-location/58370/4 "2006-04-21T12:25:37Z")

</div>

> > > > > “Eric” == Eric B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> /var/www/BADlocation# ruby script/server  
> ./script/…/config/boot.rb:15:in `require’: no such file to load –  
> rubygems (LoadError)

## Are you sure that you’re using the same ruby in both cases? That looks like you don’t have Gems installed, and it doesn’t make sense if Ruby can find Gems when you run it in one directory but not in another.

```
	     Calle D. <removed_email_address@domain.invalid>
	 http://www.livejournal.com/users/cdybedahl/
 "If the number one item on the web is porn, number two has gotta be
	  complaining." -- robin_d_laws, LiveJournal

```

---

<div class="post-metadata">

**Author:** ![blair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@blair](https://www.ruby-forum.com/u/blair)\
**Post date:** [April 21, 2006, 12:14pm UTC](https://www.ruby-forum.com/t/how-to-change-project-location/58370/5 "2006-04-21T12:14:08Z")

</div>

> Eric B. wrote:
> 
> > I moved a project … what do I have to change in config?  
> > The server does not start anymore.

Dan Perez wrote:

> Which server?

Webrick on Debian 3.1 (Sarge). It is a fresh Ruby on Rails installation,  
I followed the instructions for creating a project on mysql database and  
it works fine. It also works on another server when I copy the databases  
and the whole project root folder containing everything. This is what  
the Webrick server says when it starts fine:

:/var/www/GOODlocation# ruby script/server  
=\> Booting WEBrick…  
=\> Rails application started on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Ctrl-C to shutdown server; call with --help for options  
[2006-04-21 12:00:13] INFO WEBrick 1.3.1  
[2006-04-21 12:00:13] INFO ruby 1.8.4 (2005-12-24) [i486-linux]  
[2006-04-21 12:00:13] INFO WEBrick::HTTPServer#start: pid=619  
port=3000

> Do you get an error message?

This is what it says, when I rename the project directory:

/var/www/BADlocation# ruby script/server  
./script/…/config/boot.rb:15:in `require’: no such file to load –  
rubygems (LoadError)  
from ./script/…/config/boot.rb:15  
from script/server:2

development.log says:

# Logfile created on Fri Apr 21 12:00:13 CEST 2006 by logger.rb/1.5.2.7

The Linux syslog “/var/log/syslog” doesn’t have any new entries. I can  
provied more information if you say what you’d like. Sorry for the short  
question in the first place, I believed that this was a common problem  
(as it is a common task to move a project) with a simple answer. I  
learned all is simple in rails 😉

Thank you for your patience.  
Eric B.

---

<div class="post-metadata">

**Author:** ![blair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@blair](https://www.ruby-forum.com/u/blair)\
**Post date:** [April 21, 2006, 8:27pm UTC](https://www.ruby-forum.com/t/how-to-change-project-location/58370/6 "2006-04-21T20:27:09Z")

</div>

Calle D. wrote:

> Are you sure that you’re using the same ruby in both cases? That looks  
> like you don’t have Gems installed, and it doesn’t make sense if Ruby  
> can find Gems when you run it in one directory but not in another.

This makes sense.

So how can it be possible that the server starts from a dir that I did  
create with the “rails”-command… but not from another one? Is this  
directory written somewhere?

Eric

---

<div class="post-metadata">

**Author:** ![blair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@blair](https://www.ruby-forum.com/u/blair)\
**Post date:** [April 22, 2006, 12:47am UTC](https://www.ruby-forum.com/t/how-to-change-project-location/58370/7 "2006-04-22T00:47:26Z")

</div>

Eric B. wrote:

> Calle D. wrote:
> 
> > Are you sure that you’re using the same ruby in both cases? That looks  
> > like you don’t have Gems installed, and it doesn’t make sense if Ruby  
> > can find Gems when you run it in one directory but not in another.
> 
> This makes sense.
> 
> So how can it be possible that the server starts from a dir that I did  
> create with the “rails”-command… but not from another one? Is this  
> directory written somewhere?
> 
> Eric

From the bad location can you run “gem -v”. If that works then webrick  
should be able to find gems ok and everything should be fine. If it  
dosent work maybe you need to reinstall ruby gems?

---

<div class="post-metadata">

**Author:** ![blair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@blair](https://www.ruby-forum.com/u/blair)\
**Post date:** [April 21, 2006, 8:20pm UTC](https://www.ruby-forum.com/t/how-to-change-project-location/58370/8 "2006-04-21T20:20:24Z")

</div>

Calle D. wrote:

> > Eric B. writes:
> 
> > /var/www/BADlocation# ruby script/server  
> > ./script/…/config/boot.rb:15:in `require’: no such file to load –  
> > rubygems (LoadError)
> 
> Are you sure that you’re using the same ruby in both cases?

Yes. I did this immediateley after just stopping Webrick and renaming.

What I left out (but I really did it that way):

Ctrl-C (to interrupt Webrick from happily running)  
cd …  
mv GOODlocation BADlocation  
cd BADlocation  
ruby script/server

And then the error appears like shown above.

My experience here is: when I use the same path for the project, even on  
different machines, webrick starts. When I stop it and rename the  
directory, it does not start again. This also tested on 2 different  
machines.

I thought there might be the “install-dir” somewhere saved inside the  
project? Although I find this strange, it does not fit my expectation of  
rails.

And from your replies (or no replies) I guess that you expect the same:

It is not neccessary to store the dir in a config file, and this would  
make the whole thing less flexible.

Eric

---

<div class="post-metadata">

**Author:** ![blair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@blair](https://www.ruby-forum.com/u/blair)\
**Post date:** [April 24, 2006, 12:12am UTC](https://www.ruby-forum.com/t/how-to-change-project-location/58370/9 "2006-04-24T00:12:06Z")

</div>

Calle D. wrote:

> I don’t remember (and I’m too lazy to go back and check) if you had  
> this problem with a freshly created Rails framework or only with your  
> full application?

It happens with an application that I was developing for some days.

And I just tested the other case by creating a new application with the  
command “rails testapp”. Again the same, webrick runs, but after  
stopping and renaming to testapp1 it produces the same error messages.

> From the bad location can you run “gem -v”

I tried the gem command, but it is never found. I did not install rails  
with gems, but with apt-get from Debian “testing”-sources. So maybe gems  
is not there?

I decided to start with a fresh server and this time use “gems”. I hope  
my problems will vanish then.

Thank you very much  
Eric

---

<div class="post-metadata">

**Author:** ![blair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@blair](https://www.ruby-forum.com/u/blair)\
**Post date:** [April 22, 2006, 10:31am UTC](https://www.ruby-forum.com/t/how-to-change-project-location/58370/10 "2006-04-22T10:31:35Z")

</div>

> > > > > “Eric” == Eric B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> My experience here is: when I use the same path for the project,  
> even on different machines, webrick starts. When I stop it and  
> rename the directory, it does not start again. This also tested on 2  
> different machines.

I currently develop on two machines, one Fedora Core 4 and one OSX,  
and deploy to a third running Solaris. The application doesn’t live in  
the same place on any of them, yet there have never been any problems  
with simply checking the thing out of Subversion and running it.

> And from your replies (or no replies) I guess that you expect the same:  
> It is not neccessary to store the dir in a config file, and this would  
> make the whole thing less flexible.

I not only expect it, it does work like that on my machines. Example:

kadath:/tmp/demo$ ruby script/server webrick  
=\> Booting WEBrick…  
=\> Rails application started on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Ctrl-C to shutdown server; call with --help for options  
[2006-04-22 10:24:54] INFO WEBrick 1.3.1  
[2006-04-22 10:24:54] INFO ruby 1.8.4 (2005-12-24)  
[powerpc-darwin8.5.0]  
[2006-04-22 10:24:54] INFO WEBrick::HTTPServer#start: pid=2376  
port=3000  
^C[2006-04-22 10:24:56] INFO going to shutdown …  
[2006-04-22 10:24:56] INFO WEBrick::HTTPServer#start done.  
kadath:/tmp/demo$ cd …  
kadath:/tmp$ mv demo omed  
kadath:/tmp$ cd omed/  
kadath:/tmp/omed$ ruby script/server webrick  
=\> Booting WEBrick…  
=\> Rails application started on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Ctrl-C to shutdown server; call with --help for options  
[2006-04-22 10:25:11] INFO WEBrick 1.3.1  
[2006-04-22 10:25:11] INFO ruby 1.8.4 (2005-12-24)  
[powerpc-darwin8.5.0]  
[2006-04-22 10:25:11] INFO WEBrick::HTTPServer#start: pid=2378  
port=3000  
^C[2006-04-22 10:25:16] INFO going to shutdown …  
[2006-04-22 10:25:16] INFO WEBrick::HTTPServer#start done.  
kadath:/tmp/omed$

## I don’t remember (and I’m too lazy to go back and check) if you had this problem with a freshly created Rails framework or only with your full application?

```
	     Calle D. <removed_email_address@domain.invalid>
	 http://www.livejournal.com/users/cdybedahl/

```

“You know, if I garbage collected my brain I wouldn’t have anything  
left.”  
– Paul Tomblin, BofhNet
