简体   繁体   English

活动记录Ruby on Rails错误

[英]Active record ruby on rails error

I have not gone too far with the development of the application. 对于应用程序的开发,我还没有做太多。
i just did rails new app -d mysql and i did rails s loaded my browser. 我只是用rails new app -d mysql然后用rails s加载了我的浏览器。

Rails homepage loaded and I went inside my app folder, http://localhost:3000/demo/index and surprised to see this error ActiveRecord::ConnectionNotEstablished . 加载了Rails主页,我进入了我的应用文件夹http://localhost:3000/demo/index ,惊讶地看到此错误ActiveRecord::ConnectionNotEstablished
Please suggest some good way to get out of this and continue with my further development. 请提出一些摆脱这种情况的好方法,并继续进行进一步的开发。

OS is Windows 7, I already installed mysql adapter and tried many solutions over the stackoverflow similar questions. 操作系统是Windows 7,我已经安装了mysql适配器,并尝试了许多解决stackoverflow类似问题的解决方案。 None are solving my issue. 没有人能解决我的问题。 I request serious help. 我需要认真的帮助。
My database.yml looks like this with regards to development: 关于开发,我的database.yml如下所示:

development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: app_development
  pool: 5
  username: root
  password: pass
  host: localhost

After creating application, create database using below command 创建应用程序后,使用以下命令创建数据库

 rake db:create

and then start server using rails s 然后使用rails s启动服务器

I switched to Ubuntu after trying number of methods to solve the issue on windows. 在尝试了多种方法来解决Windows上的问题后,我切换到了Ubuntu。 Solved. 解决了。

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

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