[英]ActiveRecord::ConnectionNotEstablished error with ruby on rails
I was trying to learn ruby on rails, so I installed the gem
version 4.0.0, when I start my server, and go to localhost:8000
, it brings me an error page with error message: 我试图学习Rails,所以我安装了
gem
版本4.0.0,当我启动服务器时,转到localhost:8000
,它给我一个错误页面,并显示错误消息:
ActiveRecord::ConnectionNotEstablished.
ActiveRecord :: ConnectionNotEstablished。
I'm using sqlite3, not MySQL. 我正在使用sqlite3,而不是MySQL。 Any help is appreciated.
任何帮助表示赞赏。
edit: i fixed it, had to do with my database.yml 编辑:我修复它,与我的database.yml有关
Make sure that you have installed sqlite3 gem: gem install sqlite3
or run bundle install
if you have the gem listed on your Gemfile (which you should). 确保已安装sqlite3 gem:
gem install sqlite3
或运行bundle install
如果您的Gemfile中列出了gem)(应该这样做)。
After that run the following commands: 之后,运行以下命令:
If the above two works fine, your application should be able to connect to the database. 如果以上两种方法均能正常工作,则您的应用程序应该能够连接到数据库。 If not you probably have a configuration problem on your
config/database.yml
. 如果不是这样,您可能在
config/database.yml
上遇到配置问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.