簡體   English   中英

Webrick Rails Server無法正常運行

[英]Webrick Rails Server doesn't run correctly

我花了最后6個小時來解決一些問題,例如修改$ PATH,安裝Gems以便最終獲得應有的一切。 但是在我創建包含項目組件的項目文件夾並嘗試運行服務器后,我收到了以下消息:-

\KAMAL$ ls
Gemfile     README.rdoc app     config.ru   doc     log     script      tmp
Gemfile.lock    Rakefile    config      db      lib     public      test        vendor
\KAMAL$ rails server
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Access denied for user 'root'@'localhost' (using password: NO) (Mysql2::Error)
    from /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
    from /Library/Ruby/Gems/1.8/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'

和上面的許多行一樣

寶石清單*當地寶石*

actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
arel (3.0.2)
builder (3.0.4)
bundler (1.3.5)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.2)
erubis (2.7.0)
execjs (1.4.0)
hike (1.2.2)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.2.1)
json (1.7.7)
mail (2.5.3)
mime-types (1.22)
multi_json (1.7.2)
mysql2 (0.3.11)
polyglot (0.3.3)
rack (1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.13)
railties (3.2.13)
rake (10.0.4)
rdoc (3.12.2)
rubygems-update (2.0.3)
sass (3.2.7)
sass-rails (3.2.6)
sprockets (2.2.2)
thor (0.18.1)
tilt (1.3.7)
treetop (1.4.12)
tzinfo (0.3.37)
uglifier (2.0.1)
webrick (1.3.1) 

請幫忙

此日志條目

Access denied for user 'root'@'localhost' (using password: NO) (Mysql2::Error)

顯示您正在使用本地用戶root在localhost而不使用密碼作為數據庫。 MySQL找不到有效用戶。 以下行應發出相同的錯誤消息:

mysql -u root -h localhost

因此,請檢查db/database.yml文件中的數據庫用戶/密碼

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM