简体   繁体   English

启动Rails服务器时出现问题

[英]Issues starting a rails server

I am working on an application that makes use of Ruby on Rails. 我正在开发一个使用Ruby on Rails的应用程序。 There are 5 of us in the group and so we are using GitHub. 该小组中有5个人,因此我们正在使用GitHub。 I have rails setup on my computer and am able to create my own projects and databases from scratch but when I clone our existing project from GitHub and try to start the server I run into all sorts of issues. 我在计算机上安装了Rails,并能够从头开始创建自己的项目和数据库,但是当我从GitHub克隆现有项目并尝试启动服务器时,遇到了各种各样的问题。

I should mention that I am working on a Windows 7 machine and the initial project was created on a Linux machine. 我应该提到我正在Windows 7计算机上工作,并且最初的项目是在Linux计算机上创建的。 I imagine this could be the source of some of the issues. 我想这可能是某些问题的根源。

Bottom line, when I am in the necessary folder and I type rails s I get a lengthy error message that starts with: 最重要的是,当我在必要的文件夹中并且键入rails s我收到一条长错误消息,其开头为:

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32
/lib/mysql2/client.rb:44:in `connect': Access denied for user 'root'@'localhost'
(using password: NO) (Mysql2::Error)

There is a ton more information that I could provide but I'm not sure what all is needed to help solve this issue. 我可以提供更多的信息,但是我不确定需要什么来帮助解决此问题。 I am a beginner (both with StackOverflow and RoR) so I apologize for not being more clear and concise. 我是一个初学者(同时使用StackOverflow和RoR),所以我为您变得不够清晰和简洁而深表歉意。

Thanks in advance. 提前致谢。

Additional Information: 附加信息:

  • mysql: Ver 14.14 Distrib 5.5.30, for Win 64 (x86) mysql:版本14.14 Distrib 5.5.30,适用于Win 64(x86)
  • ruby: Ver 1.9.3p125 红宝石:版本1.9.3p125
  • rails: Ver 3.2.0 rails:3.2.0版
  • mysql gem: Ver 2.9.1 mysql gem:版本2.9.1
  • mysql2 gem: Ver 0.3.11 mysql2 gem:版本0.3.11

It seems that your rails app is trying to log into MySQL with the wrong credentials. 看来您的Rails应用正在尝试使用错误的凭据登录MySQL。

Update the file config/databases.yml to set the rights credentials. 更新文件config / databases.yml以设置权限凭证。

Note that this file should not be checked into version control since it is different for each member of the team. 请注意,此文件不应签入版本控制,因为每个团队成员的文件都不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM