A version problem

After updating, script/server fails with this stack trace:

script/server -u
/.../1.8/rubygems.rb:223:in `activate': undefined method `map' for
nil:NilClass (NoMethodError)
  from /.../1.8/rubygems/custom_require.rb:35:in `require'
  from <project>/vendor/rails/railties/lib/commands/server.rb:1
  from /.../1.8/rubygems/custom_require.rb:31:in `gem_original_require'
  from /.../1.8/rubygems/custom_require.rb:31:in `require'
  from script/server:3

script/server:3 is a blank line after "require 'action_controller'"

Any idea, how to fix this?

upgraded what to what? rails? ruby ?

radhames brito wrote:

upgraded what to what? rails? ruby ?

ruby from 1.8.6 to 1.8.7 and a gem update.

How to reinstall the rails stuff in the application folder after
removing the old components?

You would do better to try and make your questions more easy to understand.

Do you mean updating the scripts and so on? If so then
rake rails:update
There is no need to remove the old ones first (I don't know whether it
will cause a problem or not).

If you want to use a later version of rails in the app you will first
have to update the RAILS_GEM_VERSION line in environment.rb

Colin

gem clean and clean the old gems then rake gem install

radhames brito wrote:

gem clean and clean the old gems then rake gem install

What do you mean with "clean the old gems"?

Colin Law wrote:

Do you mean updating the scripts and so on? If so then
rake rails:update

Running rake rails:update seems to end in a similar problem, as running
script/server:

sudo rake --trace rails:update
(in /home/inet/Aptana RadRails Workspace/wvz)
rake aborted!
undefined method `map' for nil:NilClass
/usr/local/lib/site_ruby/1.8/rubygems.rb:223:in `activate'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:35:in `require'
/home/inet/Aptana RadRails
Workspace/wvz/vendor/rails/railties/lib/tasks/misc.rake:18
/home/inet/Aptana RadRails
Workspace/wvz/vendor/rails/railties/lib/tasks/rails.rb:4:in `load'
/home/inet/Aptana RadRails
Workspace/wvz/vendor/rails/railties/lib/tasks/rails.rb:4
/home/inet/Aptana RadRails
Workspace/wvz/vendor/rails/railties/lib/tasks/rails.rb:4:in `each'
/home/inet/Aptana RadRails
Workspace/wvz/vendor/rails/railties/lib/tasks/rails.rb:4
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/inet/Aptana RadRails Workspace/wvz/Rakefile:10
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in
`raw_load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in
`load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in
`load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

Colin Law wrote:

Do you mean updating the scripts and so on? If so then
rake rails:update

Running rake rails:update seems to end in a similar problem, as running
script/server:

sudo rake --trace rails:update

I do not know whether it is part of the problem but you should not use
sudo here. You should be in the top level folder of the rails
application (the folder with app, config etc in it) then just
rake rails_update
with --trace if you like.

Have you tried just making a new rails app to make sure that is ok?
If that works then it is an issue with your existing app, if it
doesn't it is a problem with your system.

Colin

Colin Law wrote:

sudo rake --trace rails:update

I do not know whether it is part of the problem but you should not use
sudo here.

I was in the top level folder, w/o sudo, I get the same crash.

Have you tried just making a new rails app to make sure that is ok?
If that works then it is an issue with your existing app, if it
doesn't it is a problem with your system.

Do you mean to create a new rails app and copy my sources into the new
project?

If that works then it is an issue with your existing app, if it
doesn't it is a problem with your system.

It is for sure a problem from updating ruby/rails, since the app worked
until I tried to update and I didn't touch any sources.

gem cleanup will remove any old gem you have is good if there is an older version of a gem that is causing a conflict

as old i mean in case you have more than one version of a gem it will remove the old one and leave the newest version

Colin Law wrote:

sudo rake --trace rails:update

I do not know whether it is part of the problem but you should not use
sudo here.

I was in the top level folder, w/o sudo, I get the same crash.

Have you tried just making a new rails app to make sure that is ok?
If that works then it is an issue with your existing app, if it
doesn't it is a problem with your system.

Do you mean to create a new rails app and copy my sources into the new
project?

No, make a new rails app and check that it works without any of your
sources. That will prove that a rails app *can* work on your system.

If that works then it is an issue with your existing app, if it
doesn't it is a problem with your system.

It is for sure a problem from updating ruby/rails, since the app worked
until I tried to update and I didn't touch any sources.

You do not know (or at least I do not know) whether it is a problem
with your app being incompatible with the updated system, or whether
it is a fundamental problem with your system such that it cannot run
any rails app at all. In other words whether you need to fix your
system or fix your app to be compatible with your system. The above
test (making a new simple app and making sure it works) should show
that.

Colin

Colin Law wrote:

It is for sure a problem from updating ruby/rails, since the app worked
until I tried to update and I didn't touch any sources.

You do not know (or at least I do not know) whether it is a problem
with your app being incompatible with the updated system, or whether
it is a fundamental problem with your system such that it cannot run
any rails app at all.

As I said yesterday: it's not my app which is broken, it is my rails
environment: a new generated project gest started with script/server

OK, I found a simple trick to get the app running again: renaming the
vendor folder and creating a an empty new one.