击中错误ruuning rails 2.2.2

时间:2012-08-20 07:04:33

标签: ruby-on-rails-3

ruby script/server
=> Booting WEBrick...
/home/rao/Documents/homir /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:74:in `establish_connection': Please install the postgres adapter: `gem install activerecord-postgres-adapter` (no such file to load -- active_record/connection_adapters/postgres_adapter) (RuntimeError)
    from /home/rao/Documents/homir /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:58:in `establish_connection'
    from /home/rao/Documents/homir /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:53:in `establish_connection'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:392:in `initialize_database'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:139:in `process'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:112:in `send'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:112:in `run'
    from /home/rao/Documents/homir /config/environment.rb:13
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
    from /home/rao/Documents/homir /vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    from /home/rao/Documents/homir /vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /home/rao/Documents/homir /vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    from /home/rao/Documents/homir /vendor/rails/railties/lib/commands/servers/webrick.rb:59
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
    from /home/rao/Documents/homir /vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    from /home/rao/Documents/homir /vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /home/rao/Documents/homir /vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    from /home/rao/Documents/homir /vendor/rails/railties/lib/commands/server.rb:49
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
    from script/server:3

1 个答案:

答案 0 :(得分:0)

错误显示您正在使用prosgres但未安装其适配器。

只需在您的gem文件中添加gem 'pg'并运行bundle install