Ruby on rails Webrick Rails服务器没有';我跑不好

Ruby on rails Webrick Rails服务器没有';我跑不好,ruby-on-rails,webrick,mysql2,Ruby On Rails,Webrick,Mysql2,在过去的6个小时里,我一直在解决一些问题,比如修改$PATH,安装Gems,最终让一切都恢复原样。 但是,在我使用其组件创建项目文件夹并尝试运行服务器后,我收到以下消息:- \KAMAL$ ls Gemfile README.rdoc app config.ru doc log script tmp Gemfile.lock Rakefile config db lib public test

在过去的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)
显示您正在使用localhost上的用户root而不使用密码作为数据库。MySQL未发现此用户为有效用户。以下行应发出相同的错误消息:

mysql -u root -h localhost

因此,在
db/database.yml
文件中检查您的数据库用户/密码

您的
config/database.yml
看起来像什么?在
development
下,您似乎指定了
mysql
作为适配器,
root
作为用户。查看该配置中的
数据库
名称,并使用MySQL客户端验证根用户是否可以连接到该数据库。还有,为什么你认为这是WEBrick的错呢?我有mysql的密码,我用密码通过终端连接到mysql,我确实毫无问题地显示了数据库。我如何找到db/database.ymlfile@Ahmedelhamahmy文件位于
路径/to/your/application/db/database.yml
中。我强烈建议您遵循,以便更好地了解您正在做什么。为什么服务器直接启动和结束,而我无法在localhost下的浏览器上访问它:3000@Ahmedelhamahmy因为它不能访问数据库,而且您有扩展ActiveRecord::Base的模型,所以它是运行的先决条件。对不起,我不再回答你的问题了,我强烈建议你接受Rails诅咒之类的。