开发者

Ruby on Rails installation error on Ubuntu

I am a newbie to rails. I just started learning Ubuntu, I am using version 10.04 especially to work on rails and use feedzirra in my college project.

I am getting the following error. Could you please help.

anergroup@ubuntu:~/ruby$ ruby -v
ruby 1.8.8dev (2010-10-01) [i686-linux]
anergroup@ubuntu:~/ruby$ rails -v
Rails 2.3.8

The list of gems I have are

anergroup@ubuntu:~/ruby$ sudo gem list

*** LOCAL GEMS ***

actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (3.0.0, 2.3.8)
builder (2.1.2)
cgi_multipart_eof_fix (2.5.0)
daemons (1.1.0)
fastthread (1.0.7)
gem_plugin (0.2.3)
mdalessio-dryopteris (0.1.2)
mongrel (1.1.5)
mongrel_cluster (1.0.5)
mysql (2.8.1)
nokogiri (1.4.3.1)
pauldix-feedzirra (0.0.18)
pauldix-sax-machine (0.0.14)
rack (1.1.0)
rails (2.3.8)
rake (0.8.7)
taf2-curb (0.5.4.0)
xml-simple (1.0.12)

To start the server, I typed ruby script/server

    anergroup@ubuntu:~/ruby/testapp$ ruby script/server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails 2.2.3 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
Exiting
/home/anergroup/ruby/testapp/config/initializers/cookie_verification_secret.rb:7: undefined metho开发者_C百科d `cookie_verifier_secret=' for ActionController::Base:Class (NoMethodError)
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:142:in `load_without_new_constant_marking'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:142:in `load'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:142:in `load'
    from /home/anergroup/ruby/testapp/config/../vendor/rails/railties/lib/initializer.rb:550:in `load_application_initializers'
    from /home/anergroup/ruby/testapp/config/../vendor/rails/railties/lib/initializer.rb:549:in `each'
    from /home/anergroup/ruby/testapp/config/../vendor/rails/railties/lib/initializer.rb:549:in `load_application_initializers'
    from /home/anergroup/ruby/testapp/config/../vendor/rails/railties/lib/initializer.rb:167:in `process'
    from /home/anergroup/ruby/testapp/config/../vendor/rails/railties/lib/initializer.rb:112:in `send'
    from /home/anergroup/ruby/testapp/config/../vendor/rails/railties/lib/initializer.rb:112:in `run'
    from /home/anergroup/ruby/testapp/config/environment.rb:9
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:147:in `rails'
    from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in `cloaker_'
    from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:149:in `call'
    from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:149:in `listener'
    from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_'
    from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:50:in `call'
    from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:50:in `initialize'
    from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new'
    from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run'
    from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in `run'
    from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:142:in `load_without_new_constant_marking'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:142:in `load'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:142:in `load'
    from /home/anergroup/ruby/testapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:64
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /home/anergroup/ruby/testapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    from /home/anergroup/ruby/testapp/vendor/rails/railties/lib/commands/server.rb:49
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from script/server:3

Why am I getting this error? Is there any config that I am missing?

Also, is there a good ruby on rails emacs tutorial for a newbie?

Thanks for the help

Gautam


It seems that you have 2 versions of Rails installed: 2.3.8 (as in rails -v) and 2.3.3 (as in the error log). Enforce the newer one in your application:

# config/environment.rb
RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION

You can user rvm to switch between them. The simplest thing to do, though, is to uninstall the Ubuntu-rails packages and install the rails gem.

The method cookie_verifier_secret= is deprecated, so you may comment them safely.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜