[英]ActiveRecord::ConnectionNotEstablished I have this error when I want to open localhost:3000
I am new to Web Development and have started learning Ruby on Rails from Lynda tutorial "Ruby on Rails Essential Training 4". 我是Web开发的新手,已经开始从Lynda教程“ Ruby on Rails Essential Training 4”学习Ruby on Rails。
I got stuck when I was loading page from localhost:3000. 当我从localhost:3000加载页面时,我被卡住了。 I receive the following error every time I open localthost:3000:
每当我打开localthost:3000时,我都会收到以下错误消息:
ActiveRecord::ConnectionNotEstablished
Till this point I have installed all the gems as required in the tutorial and everything worked fine. 至此,我已经按照教程中的要求安装了所有gem,一切正常。 Can somebody help me please?
有人可以帮我吗? Thanks.
谢谢。
I was following this series too, you shouldn't run into this problem if you install rails 4.2.6. 我也遵循此系列,如果您安装rails 4.2.6,则不应遇到此问题。
You'll need to tweak this command to install version 4.2.6 if 5.0.0 comes out. 如果5.0.0发布,则需要调整此命令以安装4.2.6版本。
gem install rails --no-ri --no-rdoc
gem安装滑轨--no-ri --no-rdoc
And it installed 4.2.6 on top of 4.0.0. 并且它在4.0.0之上安装了4.2.6。 I then deleted the simple_cms site folder and reinstalled it per the video and after editing the database.yml file which will be slightly different from is, I added my MySQL password to this section of the config -
然后,我删除了simple_cms站点文件夹,并根据视频重新安装了该文件夹,并在编辑了database.yml文件之后,它与稍有不同,我在配置的这一部分中添加了MySQL密码-
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password: **InsertYourMySQLPWHere**
host: localhost
Start up the rails server and then you should get the welcome page. 启动rails服务器,然后您将获得欢迎页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.