我是Rails的新手,我正在关注Skillshare(http://www.skillshare.com/classes/technology/Ruby-on-Rails-in-30-Days-Build-Your-First-Web-App/)的教程。
在我为Post创建一个新的脚手架时,我从终端获得了所有正确的输出。但是,当我在浏览器中刷新我的localhost:3000时,我收到一条消息“此网页不可用”,但我希望收到“ActiveRecord :: PendingMigrationError”的错误消息。无论如何我继续运行db rake,但我仍然得到了“这个网页不可用”的信息。任何帮助将不胜感激。下面是我输入终端的内容。
allison:crumblr aehn83$ rails generate scaffold Post title:string content:text --no-stylesheets
invoke active_record
identical db/migrate/20141106005237_create_posts.rb
identical app/models/post.rb
invoke test_unit
identical test/models/post_test.rb
identical test/fixtures/posts.yml
invoke resource_route
route resources :posts
invoke scaffold_controller
identical app/controllers/posts_controller.rb
invoke erb
exist app/views/posts
identical app/views/posts/index.html.erb
identical app/views/posts/edit.html.erb
identical app/views/posts/show.html.erb
identical app/views/posts/new.html.erb
identical app/views/posts/_form.html.erb
invoke test_unit
identical test/controllers/posts_controller_test.rb
invoke helper
identical app/helpers/posts_helper.rb
invoke test_unit
identical test/helpers/posts_helper_test.rb
invoke jbuilder
identical app/views/posts/index.json.jbuilder
identical app/views/posts/show.json.jbuilder
invoke assets
invoke coffee
identical app/assets/javascripts/posts.js.coffee
invoke scss
答案 0 :(得分:0)
运行
rake db:migrate
然后运行服务器
rails s
答案 1 :(得分:0)
看起来你跑了
db rake
而不是
rake db:migrate
错误说“正在等待迁移”它正在谈论迁移数据库
答案 2 :(得分:-1)
听起来你的rails服务器没有运行。
有时候我只使用一个终端时会犯同样的错误。
确保在进行更改后使用rails s
重新启动服务器