绑定 3000 或其它端口正常
执行以下命令出错: rvmsudo rails s -p 80
提示:
Warning: can not check /etc/sudoers
for secure_path
, falling back to call via /usr/bin/env
, this breaks rules from /etc/sudoers
. Run:
export rvmsudo_secure_path=1
to avoid the warning, put it in shell initialization file to make it persistent.
In case there is no secure_path
in /etc/sudoers
. Run:
export rvmsudo_secure_path=0
to avoid the warning, put it in shell initialization file to make it persistent.
程序还是启动了,当浏览器访问 ip:80 时候会报错: Started GET "/" for 123.112.109.4 at 2014-05-22 22:44:25 +0800
PG::ConnectionBad (FATAL: Peer authentication failed for user "lpxiao"
):
activerecord (4.0.3) lib/active_record/connection_adapters/postgresql_adapter.rb:831:in initialize'
activerecord (4.0.3) lib/active_record/connection_adapters/postgresql_adapter.rb:831:in
new'
activerecord (4.0.3) lib/active_record/connection_adapters/postgresql_adapter.rb:831:in connect'
activerecord (4.0.3) lib/active_record/connection_adapters/postgresql_adapter.rb:548:in
initialize'
activerecord (4.0.3) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in new'
activerecord (4.0.3) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in
postgresql_connection'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in new_connection'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in
checkout_new_connection'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in acquire_connection'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in
block in checkout'
/home/lpxiao/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in
checkout'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in block in connection'
/home/lpxiao/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in
mon_synchronize'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in connection'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in
retrieve_connection'
activerecord (4.0.3) lib/active_record/connection_handling.rb:79:in retrieve_connection'
activerecord (4.0.3) lib/active_record/connection_handling.rb:53:in
connection'
activerecord (4.0.3) lib/active_record/query_cache.rb:51:in restore_query_cache_settings'
activerecord (4.0.3) lib/active_record/query_cache.rb:43:in
rescue in call'
activerecord (4.0.3) lib/active_record/query_cache.rb:32:in call'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in
call'
actionpack (4.0.3) lib/action_dispatch/middleware/callbacks.rb:29:in block in call'
activesupport (4.0.3) lib/active_support/callbacks.rb:373:in
run1677853200884953723call_callbacks'
activesupport (4.0.3) lib/active_support/callbacks.rb:80:in run_callbacks'
actionpack (4.0.3) lib/action_dispatch/middleware/callbacks.rb:27:in
call'
actionpack (4.0.3) lib/action_dispatch/middleware/reloader.rb:64:in call'
actionpack (4.0.3) lib/action_dispatch/middleware/remote_ip.rb:76:in
call'
actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in call'
actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in
call'
railties (4.0.3) lib/rails/rack/logger.rb:38:in call_app'
railties (4.0.3) lib/rails/rack/logger.rb:20:in
block in call'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in block in tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in
tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in tagged'
railties (4.0.3) lib/rails/rack/logger.rb:20:in
call'
actionpack (4.0.3) lib/action_dispatch/middleware/request_id.rb:21:in call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in
call'
rack (1.5.2) lib/rack/runtime.rb:17:in call'
activesupport (4.0.3) lib/active_support/cache/strategy/local_cache.rb:83:in
call'
rack (1.5.2) lib/rack/lock.rb:17:in call'
actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in
call'
rack (1.5.2) lib/rack/sendfile.rb:112:in call'
railties (4.0.3) lib/rails/engine.rb:511:in
call'
railties (4.0.3) lib/rails/application.rb:97:in call'
rack (1.5.2) lib/rack/lock.rb:17:in
call'
rack (1.5.2) lib/rack/content_length.rb:14:in call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in
service'