almost 2 years ago

git clone 下来自己的项目之后,运行rails s,网页端打开报错

liu@liudeMBP  ~/job-listing ⮀ ⭠ version-1 ⮀ rails s
=> Booting Puma
=> Rails 5.0.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
/Users/liu/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0/lib/rails/application/configuration.rb:143:in `database_configuration': Cannot load `Rails.application.database_configuration`: (RuntimeError)
Could not load database configuration. No such file - ["config/database.yml"]

解决方法:
执行命令cp config/database.yml.example config/database.yml
bundle check
bundle install
rails s

运行网站后,网站提示报错信息:

ActiveRecord::PendingMigrationError
Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=development


解决方法:
执行bin/rails db:migrate RAILS_ENV=development
rake db:drop
rake db:create
rake db:migrate
如果仍有问题,请打开db/schema.rb文件中,看一下专案名称的数字

← 1/5 日记 1/6 日记 →
 
comments powered by Disqus