How to change project location?


#1

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


#2

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…


#3

“Eric” == Eric B. 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:
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.

#4

“Eric” == Eric B. 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

#5

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
=> 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 :wink:

Thank you for your patience.
Eric B.


#6

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


#7

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?


#8

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


#9

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


#10

“Eric” == Eric B. 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
=> 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
=> 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