Forum: Ruby on Rails problem with webrick and edge rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
empty body (Guest)
on 2006-03-18 15:08
(Received via mailing list)
i know i do not really have the right to seek help with edge rails,
but i am hoping it is something trivial.

quick scenario:

$ rails test  # create a new project
$ svn import  # import it into the repo, then go elsewhere, and checkout
$  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-03-18 07:19:57] INFO  WEBrick 1.3.1
[2006-03-18 07:19:57] INFO  ruby 1.8.4 (2005-12-24) [i686-linux]
[2006-03-18 07:19:57] INFO  WEBrick::HTTPServer#start: pid=2676
port=3000
[2006-03-18 07:20:02] INFO  going to shutdown ...
[2006-03-18 07:20:02] INFO  WEBrick::HTTPServer#start done.

no problem, webrick starts up and all is good.

now i switch to edge rails:
$ svn propset svn:externals "rails
http://dev.rubyonrails.org/svn/rails/trunk" .
$ svn up
[skipped]
Updated external to revision 3922.

here's the error:

----------------------------
$ ruby script/server
=> Booting WEBrick...
./script/../config/../vendor/rails/railties/lib/commands/../tasks/tmp.rake:1:
undefined method `namespace' for main:Object (NoMethodError)
        from
./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:142:in
`load'
        from
./script/../config/../vendor/rails/railties/lib/commands/server.rb:29
        from script/server:3
----------------------------

or even simpler:

----------------------------
$ ruby script/server -h
=> Booting WEBrick...
./script/../config/../vendor/rails/railties/lib/commands/../tasks/tmp.rake:1:
undefined method `namespace' for main:Object (NoMethodError)
        from
./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:142:in
`load'
        from
./script/../config/../vendor/rails/railties/lib/commands/server.rb:29
        from script/server:3
----------------------------

here's the environment:

$ rake --version
rake, version 0.7.0
$ rails --version
Rails 1.0.0
$ ruby --version
ruby 1.8.4 (2005-12-24) [i686-linux]
$ uname -a
Linux 2.6.15-gentoo-r1 #1 PREEMPT Thu Feb 2 00:48:08 EST 2006 i686
Pentium III (Katmai) GenuineIntel GNU/Linux


the interesting thing is that the same exact scenario works on cygwin
without any problems with exactly the same revision from rails trunk:

$ # do the whole rails test / svn import / svn co / svn externals / svn
up dance
$ 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-03-18 07:51:27] INFO  WEBrick 1.3.1
[2006-03-18 07:51:27] INFO  ruby 1.8.4 (2005-12-24) [i386-cygwin]
[2006-03-18 07:51:27] INFO  WEBrick::HTTPServer#start: pid=1012
port=3000
[2006-03-18 07:51:34] INFO  going to shutdown ...
[2006-03-18 07:51:34] INFO  WEBrick::HTTPServer#start done.

$ rake --version
rake, version 0.7.0
$ rails --version
Rails 1.0.0
$ ruby --version
ruby 1.8.4 (2005-12-24) [i386-cygwin]
$ uname -a
CYGWIN_NT-5.1 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin

in the past 24 hours i've tried about 5 latest revisions from rails
trunk, and the result is always the same.

i hope i am missing something obvious; at this point i am out of
ideas. any suggestions are welcome.

thank you.

-a
empty body (Guest)
on 2006-03-18 20:40
(Received via mailing list)
so everything points to the fact that somehow my install is using an
older version of rake that does not understand namespaces.

i can confirm this by editing
vendor/rails/railties/lib/commands/server.rb and adding the following
line:
puts "rake version is #{Rake::Application::RAKEVERSION}"

right after the line:
require_library_or_gem 'rake'

the output is: rake version is 0.6.2

now i know what the problem is (it should have been rails 0.7.0, which
is what my cygwin setup outputs), how do i fix it (and for all my
projects)? even before posting i have reinstalled rails gem and
confirmed that i indeed had rake 0.7.0. i even ran gem cleanup.

thank you for any input.

-a
empty body (Guest)
on 2006-03-18 21:35
(Received via mailing list)
SOLVED

continuing down the winding path of recollection, i did remember that
at some point out of sheer "hey ma, see what i can do" interest i have
installed rake package with the OS (emerge rake); then i promptly
forgot about it, since i started using gems. that old rake package was
0.6.2.

there was an old rake binary in  /usr/lib/ruby/gems/1.8/bin and it was
taking precendence over everything else.

thus uninstalling the package (emerge unmerge rake) solved the problem.

in retrospect it was pretty trivial. hope this posting helps someone in
future.

-a
This topic is locked and can not be replied to.