简体   繁体   English

ActiveRecord :: ConnectionNotEstablished我想打开localhost:3000时出现此错误

[英]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.

相关问题 Ruby on Rails-ActiveRecord :: ConnectionNot在localhost:3000上建立 - Ruby on Rails- ActiveRecord::ConnectionNotEstablished on localhost:3000 当我尝试打开http:// localhost:3000 / pages / home时出错 - Error when I try to open http://localhost:3000/pages/home 升级到ActiveRecord :: ConnectionNotEstablished错误 - ActiveRecord::ConnectionNotEstablished error when upgrading to 从 SQLite 切换到 Postgres 后出现“ActiveRecord::ConnectionNotEstablished”错误 - "ActiveRecord::ConnectionNotEstablished" error after I switched from SQLite to Postgres ActiveRecord::ConnectionNotEstablished 错误 - ActiveRecord::ConnectionNotEstablished error ActiveRecord :: ConnectionNotEstablished(ActiveRecord :: ConnectionNotEstablished) - ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) 启动克隆的 API 时出现 Rails 错误 - ActiveRecord::ConnectionNotEstablished - Rails error when firing up a cloned API - ActiveRecord::ConnectionNotEstablished 安装Spree ActiveRecord :: ConnectionNotEstablished错误 - Installing Spree ActiveRecord::ConnectionNotEstablished Error ActiveRecord :: ConnectionNotEstablished错误与在轨道上的红宝石 - ActiveRecord::ConnectionNotEstablished error with ruby on rails 我尝试访问https:// localhost:3000时收到Rails服务器的错误消息 - Error message received for rails server when I try to visit https://localhost:3000
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM