[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Port Ruby on Rails Application

Snoop1990 Snoop1990

12/27/2007 3:12:00 PM

Hello,
I have to leave my old server, so I did a backup and saved my ruby on
rails Applications and my mysql databases to an external USB stick and
brought them to the new server.

The backup for mysql works just fine, no errors on this side.

The next thing, I want to start the internal webrick server ... and got
an Error message. Not able to boot up ? ... And I noticed that the error
was caused because my previous server was FreeBSD and the new is Linux
(Kubuntu). So I replaced some files and get the server running and I
could access the applications first page, but then again I get an Error.
Therefore my question is, which files differ between the different
operation systems.

I have :
-app
-components
-config
-db
-doc
-lib
-log
-public
-Rakefile // file
-README // file
-script
-test
-tmp
-vendor

I'm not sure but maybe the version of rails between the servers differ
as well.
--
Posted via http://www.ruby-....

14 Answers

Frederick Cheung

12/27/2007 3:30:00 PM

0


On 27 Dec 2007, at 15:11, Snoop1990 Snoop1990 wrote:

> Hello,
> I have to leave my old server, so I did a backup and saved my ruby on
> rails Applications and my mysql databases to an external USB stick and
> brought them to the new server.
>
> The backup for mysql works just fine, no errors on this side.
>
> The next thing, I want to start the internal webrick server ... and
> got
> an Error message. Not able to boot up ? ... And I noticed that the
> error
> was caused because my previous server was FreeBSD and the new is Linux
> (Kubuntu). So I replaced some files and get the server running and I
> could access the applications first page, but then again I get an
> Error.
> Therefore my question is, which files differ between the different
> operation system

Hard to say without something more descriptive than 'an Error'.
Most of the time it shouldn't matter whether you're on ubuntu or bsd
(none of our apps care if they are on windows, linux or mac os x) but
if as you say below the version of rails is different then that could
certainly rip things up. But again without any more information it's
hard to say.

Fred
>
>
> I have :
> -app
> -components
> -config
> -db
> -doc
> -lib
> -log
> -public
> -Rakefile // file
> -README // file
> -script
> -test
> -tmp
> -vendor
>
> I'm not sure but maybe the version of rails between the servers differ
> as well.
> --
> Posted via http://www.ruby-....
>


Michael Greenly

12/27/2007 3:32:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

Yes Rails applications can be sensitive to the version of Ruby, Rails or
Gems installed

Telling us what error you got would help.

On Dec 27, 2007 9:11 AM, Snoop1990 Snoop1990 <snoopy1990@googlemail.com>
wrote:

> could access the applications first page, but then again I get an Error.
> Therefore my question is, which files differ between the different
> operation systems.
>



--
Michael Greenly

Snoop1990 Snoop1990

12/27/2007 3:48:00 PM

0

Michael Greenly wrote:
> Yes Rails applications can be sensitive to the version of Ruby, Rails or
> Gems installed
>
> Telling us what error you got would help.
>
> On Dec 27, 2007 9:11 AM, Snoop1990 Snoop1990 <snoopy1990@googlemail.com>




Ok, I use my first one, this application run on Freebsd without any
errors! I copied the hole directory and now try to start the internal
web server webrick and get this :

$ ./script/server
/script/../config/boot.rb:18:in `require': no such file to load --
rubygems (LoadError)
from ./script/../config/boot.rb:18
from ./script/server:2:in `require'
from ./script/server:2

I thought maybe Rails does not work, so I started a new projekt with the
"rails <projectname>" command and launched the internal webserver inside
this new project. It works but it looks a bit different during the boot
process:

$ ./script/server
=> Booting WEBrick...
=> Rails application started on http://127....
=> Ctrl-C to shutdown server; call with --help for options
[2007-12-27 16:42:12] INFO WEBrick 1.3.1
[2007-12-27 16:42:12] INFO ruby 1.8.6 (2007-06-07) [i486-linux]
[2007-12-27 16:42:12] WARN TCPServer Error: Address already in use -
bind(2)
/usr/lib/ruby/1.8/webrick/utils.rb:73:in `initialize': Address already
in use - bind(2) (Errno::EADDRINUSE)
from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `new'
from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners'
from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `each'
from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners'
from /usr/lib/ruby/1.8/webrick/server.rb:75:in `listen'
from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
from
/home/Share/www/snoop/blog/vendor/rails/railties/lib/webrick_server.rb:58:in
`new'
from
/home/Share/www/snoop/blog/vendor/rails/railties/lib/webrick_server.rb:58:in
`dispatch'
from
/home/Share/www/snoop/blog/vendor/rails/railties/lib/commands/servers/webrick.rb:59
from
/home/Share/www/snoop/blog/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
`require'
from
/home/Share/www/snoop/blog/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
`require'
from
/home/Share/www/snoop/blog/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
from
/home/Share/www/snoop/blog/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
`require'
from
/home/Share/www/snoop/blog/vendor/rails/railties/lib/commands/server.rb:39
from ./script/server:3:in `require'
from ./script/server:3

Booting on freebsd, the first application:
%./script/server
=> Booting WEBrick...
=> Rails application started on http://0....
=> Ctrl-C to shutdown server; call with --help for options





--
Posted via http://www.ruby-....

Snoop1990 Snoop1990

12/27/2007 3:53:00 PM

0

Snoop1990 Snoop1990 wrote:
>
> Booting on freebsd, the first application:
> %./script/server
> => Booting WEBrick...
> => Rails application started on http://0....
> => Ctrl-C to shutdown server; call with --help for options

Ups I missed :

[2007-12-27 17:47:08] INFO WEBrick 1.3.1
[2007-12-27 17:47:08] INFO ruby 1.8.6 (2007-03-13) [i386-freebsd6]
[2007-12-27 17:47:08] INFO WEBrick::HTTPServer#start: pid=817 port=3000

So the total FreeBSD webrick boot looks like:

%./script/server
=> Booting WEBrick...
=> Rails application started on http://0....
=> Ctrl-C to shutdown server; call with --help for options
[2007-12-27 17:47:08] INFO WEBrick 1.3.1
[2007-12-27 17:47:08] INFO ruby 1.8.6 (2007-03-13) [i386-freebsd6]
[2007-12-27 17:47:08] INFO WEBrick::HTTPServer#start: pid=817 port=3000

--
Posted via http://www.ruby-....

Luis Lavena

12/27/2007 4:39:00 PM

0

On Dec 27, 12:48 pm, Snoop1990 Snoop1990 <snoopy1...@googlemail.com>
wrote:
> Michael Greenly wrote:
> > Yes Rails applications can be sensitive to the version of Ruby, Rails or
> > Gems installed
>
> > Telling us what error you got would help.
>
> > On Dec 27, 2007 9:11 AM, Snoop1990 Snoop1990 <snoopy1...@googlemail.com>
>
> Ok, I use my first one, this application run on Freebsd without any
> errors! I copied the hole directory and now try to start the internal
> web server webrick and get this :
>
> $ ./script/server
> /script/../config/boot.rb:18:in `require': no such file to load --
> rubygems (LoadError)
> from ./script/../config/boot.rb:18
> from ./script/server:2:in `require'
> from ./script/server:2
>
> I thought maybe Rails does not work, so I started a new projekt with the
> "rails <projectname>" command and launched the internal webserver inside
> this new project. It works but it looks a bit different during the boot
> process:
>

script/server is yelling at you that rubygems is not installed, but
then you said that using 'rails command' manage to create a empty
application.

How did you managed to install Rails _without_ rubygems?
Maybe you used the zip or tgz package available in rubyforge, which
you should have pointed in your first mail:

- I installed ruby using freebsd ports
- I installed rails grabbing the zip package and running setup.
- THEN i get this error message.

Will be cool when users start writting that kind of reports of their
problems, but still we live in a imperfect world ;-)

> $ ./script/server
> => Booting WEBrick...
> => Rails application started onhttp://127....
> => Ctrl-C to shutdown server; call with --help for options
> [2007-12-27 16:42:12] INFO WEBrick 1.3.1
> [2007-12-27 16:42:12] INFO ruby 1.8.6 (2007-06-07) [i486-linux]
> [2007-12-27 16:42:12] WARN TCPServer Error: Address already in use -
> bind(2)
> /usr/lib/ruby/1.8/webrick/utils.rb:73:in `initialize': Address already
> in use - bind(2) (Errno::EADDRINUSE)
> from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `new'
> from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners'
> from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `each'
> from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners'
> from /usr/lib/ruby/1.8/webrick/server.rb:75:in `listen'
> from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
> from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'

Reading the error message:

WARN TCPServer Error: Address already in use - bind(2)

That means the port used by webrick is already used by another
process, and is impossible to continue beyond that point.

So:

1) install rubygems
2) look what other process/application is using port 3000 (rails
default).
3) fix your dependencies issues (and correct version of them) for
Rails and the gems you're using in your application.

HTH,
Luis Lavena

Snoop1990 Snoop1990

12/27/2007 5:11:00 PM

0

Sorry I do not get this!

I just setup a new rails application and started it at port 40000 and it
works ... why ? ... neither I nor my friend changed anything !

$ ./script/server -p 40000
=> Booting WEBrick...
=> Rails application started on http://127.0...
=> Ctrl-C to shutdown server; call with --help for options
[2007-12-27 18:00:07] INFO WEBrick 1.3.1
[2007-12-27 18:00:07] INFO ruby 1.8.6 (2007-06-07) [i486-linux]
[2007-12-27 18:00:07] INFO WEBrick::HTTPServer#start: pid=22874
port=40000


But still the same error when I try the FreeBSD application on the Linux
Server !

$ ./script/server -p 40000
/script/../config/boot.rb:18:in `require': no such file to load --
rubygems (LoadError)
from ./script/../config/boot.rb:18
from ./script/server:2:in `require'
from ./script/server:2


--
Posted via http://www.ruby-....

Snoop1990 Snoop1990

12/27/2007 5:18:00 PM

0

Snoop1990 Snoop1990 wrote:
> Sorry I do not get this!
>
> I just setup a new rails application and started it at port 40000 and it
> works ... why ? ... neither I nor my friend changed anything !
>

Found the first Error:

I get :

$ ./script/server
=> Booting WEBrick...
Rails Error: Unable to access log file. Please ensure that
/home/Share/www/snoop/backup/blog copy/log/development.log exists and is
chmod 0666. The log level has been raised to WARN and the output
directed to STDERR until the problem is fixed.
=> Rails application started on http://127....
=> Ctrl-C to shutdown server; call with --help for options
[2007-12-27 18:14:41] INFO WEBrick 1.3.1
[2007-12-27 18:14:41] INFO ruby 1.8.6 (2007-06-07) [i486-linux]
[2007-12-27 18:14:41] WARN TCPServer Error: Address already in use -
bind(2)
/usr/lib/ruby/1.8/webrick/utils.rb:73:in `initialize': Address already
in use - bind(2) (Errno::EADDRINUSE)
from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `new'
from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners'
from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `each'
from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners'
from /usr/lib/ruby/1.8/webrick/server.rb:75:in `listen'
from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
from /home/Share/www/snoop/backup/blog
copy/vendor/rails/railties/lib/webrick_server.rb:58:in `new'
from /home/Share/www/snoop/backup/blog
copy/vendor/rails/railties/lib/webrick_server.rb:58:in `dispatch'
from /home/Share/www/snoop/backup/blog
copy/vendor/rails/railties/lib/commands/servers/webrick.rb:59
from /home/Share/www/snoop/backup/blog
copy/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
`require'
from /home/Share/www/snoop/backup/blog
copy/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
`require'
from /home/Share/www/snoop/backup/blog
copy/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
from /home/Share/www/snoop/backup/blog
copy/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
`require'
from /home/Share/www/snoop/backup/blog
copy/vendor/rails/railties/lib/commands/server.rb:39
from ./script/server:3:in `require'
from ./script/server:3


Instead of :

$ ./script/server
=> Booting WEBrick...
=> Rails application started on http://127....
=> Ctrl-C to shutdown server; call with --help for options
[2007-12-27 18:13:09] INFO WEBrick 1.3.1
[2007-12-27 18:13:09] INFO ruby 1.8.6 (2007-06-07) [i486-linux]
[2007-12-27 18:13:09] INFO WEBrick::HTTPServer#start: pid=23598
port=3000

when I try to run two webrick servers at the same port on the same
system. I just mixed up to shutdown one and started another, which
causes an error. As described above. But what about the FreeBSD
application ?

When I try to start it I still get the following error :

$ ./script/server -p 40001
/script/../config/boot.rb:18:in `require': no such file to load --
rubygems (LoadError)
from ./script/../config/boot.rb:18
from ./script/server:2:in `require'
from ./script/server:2

--
Posted via http://www.ruby-....

Frederick Cheung

12/27/2007 5:23:00 PM

0


On 27 Dec 2007, at 17:18, Snoop1990 Snoop1990 wrote:

> Snoop1990 Snoop1990 wrote:
>> Sorry I do not get this!
>>
>> I just setup a new rails application and started it at port 40000
>> and it
>> works ... why ? ... neither I nor my friend changed anything !
>> py/vendor/rails/activesupport/lib/active_support/dependencies.rb:
>> 495:in
> `require'
> from /home/Share/www/snoop/backup/blog
> copy/vendor/rails/railties/lib/commands/server.rb:39
> from ./script/server:3:in `require'
> from ./script/server:3
>

This app has gems frozen in vendor

> Instead of :
>
> $ ./script/server
> => Booting WEBrick...
> => Rails application started on http://127....
> => Ctrl-C to shutdown server; call with --help for options
> [2007-12-27 18:13:09] INFO WEBrick 1.3.1
> [2007-12-27 18:13:09] INFO ruby 1.8.6 (2007-06-07) [i486-linux]
> [2007-12-27 18:13:09] INFO WEBrick::HTTPServer#start: pid=23598
> port=3000
>
> when I try to run two webrick servers at the same port on the same
> system. I just mixed up to shutdown one and started another, which
> causes an error. As described above. But what about the FreeBSD
> application ?
>
> When I try to start it I still get the following error :
>
> $ ./script/server -p 40001
> ./script/../config/boot.rb:18:in `require': no such file to load --
> rubygems (LoadError)
> from ./script/../config/boot.rb:18
> from ./script/server:2:in `require'
> from ./script/server:2
>
This one probably doesn't. Do you have rubygems installed ?

Fred

> --
> Posted via http://www.ruby-....
>


Michael Greenly

12/27/2007 5:28:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

It sounds like gems are not available?

Can you give us the results of each of these commands?

#> which ruby
#> ruby --version
#> which rails
#> rails --version
#> which gem
#> gem environment

How did you install each of these components? Ruby? Gems? Rails?

I'd recomend this path on debian/ubuntu for people who don't know why they
may want to do it differently....

Install Ruby and Gems via apt and Rails via Gems. In your case you will
also want to make sure the version of Rails your application expects is
available. To find out what version you need look in
/config/environment.rb and then install Rails with a command something
like: "gem install rails --version 1.2.6"

The one thing to remember with this setup is DON'T run 'gem update --system'


A more robust alternative is to install Ruby via apt and Gems via source
packages.




On Dec 27, 2007 9:48 AM, Snoop1990 Snoop1990 <snoopy1990@googlemail.com>
wrote:

> Michael Greenly wrote:
> > Yes Rails applications can be sensitive to the version of Ruby, Rails or
> > Gems installed
> >
> > Telling us what error you got would help.
> >
> > On Dec 27, 2007 9:11 AM, Snoop1990 Snoop1990 <snoopy1990@googlemail.com>
>
>
>
>
> Ok, I use my first one, this application run on Freebsd without any
> errors! I copied the hole directory and now try to start the internal
> web server webrick and get this :
>
> $ ./script/server
> ./script/../config/boot.rb:18:in `require': no such file to load --
> rubygems (LoadError)
> from ./script/../config/boot.rb:18
> from ./script/server:2:in `require'
> from ./script/server:2
>



--
Michael Greenly

Snoop1990 Snoop1990

12/27/2007 5:30:00 PM

0

Frederick Cheung wrote:
> On 27 Dec 2007, at 17:18, Snoop1990 Snoop1990 wrote:
>
>> copy/vendor/rails/railties/lib/commands/server.rb:39
>> from ./script/server:3:in `require'
>> from ./script/server:3
>>
>
> This app has gems frozen in vendor
>
>>
>> from ./script/../config/boot.rb:18
>> from ./script/server:2:in `require'
>> from ./script/server:2
>>
> This one probably doesn't. Do you have rubygems installed ?
>
> Fred

As you see in the posts above the Application created on Linux works on
Linux only the one created on FreeBSD and then transfered to a Linux
server does not work !
--
Posted via http://www.ruby-....