我是Ruby的新手,并且一直关注着"Ruby On Rails 3 Tutorial - Learn Ruby by Example - Michael Hartl"一书.我目前在第3章讨论静态页面.
在本章中,我在提示符中输入了以下命令:rails generate controller Pages home contact一切正常.
然后这本书指引我http://localhost:3000/pages/home.当我将浏览器指向那里时,我收到以下错误.
ActiveRecord::ConnectionNotEstablished ActiveRecord::ConnectionNotEstablished Rails.root: /home/ralph/railsprojects/sample_app Application Trace | Framework Trace | Full Trace
路由和控制器erb似乎没有任何错误.这是数据库相关的错误吗?有任何想法吗?
谢谢,DMAT
更新:
这是我的database.yml文件中的代码.
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will …Run Code Online (Sandbox Code Playgroud)