运行ruby服务器时出错

时间:2013-04-24 03:06:29

标签: ruby-on-rails ruby

我正在尝试在ubuntu 12.04,rails 2.3.11,ruby 1.8.3 gem 1.5.3中运行ruby服务器并获取此信息。这是一个依赖问题。还是配置问题。请帮帮我。提前致谢。

root@virinchy-Aspire-4535:~/BBYIDX-2/BBYIDX-master# script/server
=> Booting WEBrick
=> Rails 2.3.18 application starting on http:/0.0.0.0:3000


Faraday: you may want to install system_timer for reliable timeouts
/usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:941:in `initialize':     

我有什么需要解决的吗

FATAL:  role "bbyidx" does not exist (PGError)
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:941:in `connect'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:941:in `connect'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:217:in `initialize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `new'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in    `postgresql_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in    `new_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in   `checkout_new_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
from /usr/local/rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/monitor.rb:242:in `synchronize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in   `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in    `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in    `connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/base.rb:1299:in `table_exists?'
from /home/virinchy/BBYIDX-2/BBYIDX-master/app/models/user.rb:73
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:406:in `load_without_new_constant_marking'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:406:in `load_file'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:405:in `load_file'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:285:in `require_or_load'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:451:in `load_missing_constant'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:106:in `const_missing'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:118:in `const_missing'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/inflector.rb:364:in `constantize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/inflector.rb:363:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/inflector.rb:363:in `constantize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:157:in `observed_class'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:183:in `observed_classes'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:166:in `initialize'
from /usr/local/rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/singleton.rb:94:in `new'
from /usr/local/rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/singleton.rb:94:in `instance'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:38:in `instantiate_observers'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:36:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:36:in `instantiate_observers'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:15:in `define_dispatcher_callbacks'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:182:in `call'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:182:in `evaluate_method'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:166:in `call'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:276:in `run_callbacks'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:51:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:51:in `run_prepare_callbacks'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:631:in    `prepare_dispatcher'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:185:in   `process'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:113:in   `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:113:in `run'

from /home/virinchy/BBYIDX-2/BBYIDX-master/config/environment.rb:22

from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/commands/server.rb:84
from script/server:3:in `require'
from script/server:3

1 个答案:

答案 0 :(得分:2)

这是你的问题:

FATAL:  role "bbyidx" does not exist (PGError)

您尝试使用不存在的角色连接到PostgreSQL数据库。您可以使用终端中的createuser命令创建此角色。

createuser bbyidx