Rails problem

What wrong?

gem install rails -s http://gems.rubyonrails.org -v 2.2.0

Successfully installed activesupport-2.2.0
Successfully installed activerecord-2.2.0
Successfully installed actionpack-2.2.0
Successfully installed actionmailer-2.2.0
Successfully installed activeresource-2.2.0
Successfully installed rails-2.2.0
6 gems installed
Installing ri documentation for activesupport-2.2.0…
Installing ri documentation for activerecord-2.2.0…
Installing ri documentation for actionpack-2.2.0…
Installing ri documentation for actionmailer-2.2.0…
Installing ri documentation for activeresource-2.2.0…
Installing RDoc documentation for activesupport-2.2.0…
Installing RDoc documentation for activerecord-2.2.0…
Installing RDoc documentation for actionpack-2.2.0…
Installing RDoc documentation for actionmailer-2.2.0…
Installing RDoc documentation for activeresource-2.2.0…

rails

/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.0/bin/…/lib/rails_generator/options.rb:32:in
default_options': undefined method write_inheritable_attribute’ for
Rails::Generator::Base:Class (NoMethodError)
from
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.0/bin/…/lib/rails_generator/base.rb:90
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in require’
from
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.0/bin/…/lib/rails_generator.rb:34
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in require’
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.2.0/bin/rails:13
from /usr/local/bin/rails:19:in `load’
from /usr/local/bin/rails:19

you need to call rails with a project name:

$ rails --help
Usage: /opt/local/bin/rails /path/to/your/app [options]
Options:
-r, --ruby=path Path to the Ruby binary of your
choice (otherwise scripts use env, dispatchers current path).
Default: /opt/local/bin/ruby
-d, --database=name Preconfigure for selected
database (options: mysql/oracle/postgresql/sqlite2/sqlite3/frontbase/
ibm_db).
Default: sqlite3
-f, --freeze Freeze Rails in vendor/rails from
the gems generating the skeleton
Default: false
Rails Info:
-v, --version Show the Rails version number and
quit.
-h, --help Show this help message and quit.
General Options:
-p, --pretend Run but do not make any changes.
–force Overwrite files that already
exist.
-s, --skip Skip files that already exist.
-q, --quiet Suppress normal output.
-t, --backtrace Debugging: show backtrace on
errors.
-c, --svn Modify files with subversion.
(Note: svn must be in path)
-g, --git Modify files with git. (Note: git
must be in path)

Description:
The ‘rails’ command creates a new Rails application with a default
directory structure and configuration at the path you specify.

Example:
rails ~/Code/Ruby/weblog

This generates a skeletal Rails installation in ~/Code/Ruby/

weblog.
See the README in the newly created application to get going.
$

same problem:

$ rails test
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.0/bin/…/lib/rails_generator/options.rb:32:in
default_options': undefined methodwrite_inheritable_attribute’ for
Rails::Generator::Base:Class (NoMethodError)
from
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.0/bin/…/lib/rails_generator/base.rb:90
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
from
/usr/local/lib/ruby/gems/1.8/gems/rails-2.2.0/bin/…/lib/rails_generator.rb:34
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.2.0/bin/rails:13
from /usr/local/bin/rails:19:in `load’
from /usr/local/bin/rails:19