当我尝试使用命令rake db:migrate
时,如果表已经存在,我总会得到同样的错误
rake aborted!
NameError: uninitialized constant Psych::Coder
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
这是我的红宝石代码:
require 'rubygems'
require 'sinatra'
require 'sinatra/reloader'
require 'sinatra/activerecord'
set :database, "sqlite3:barbershop.db"
class Client < ActiveRecord::Base
end
class Barber < ActiveRecord::Base
end
我的宝石文件:
source "https://rubygems.org"
gem "sinatra"
gem "sqlite3"
gem "activerecord"
gem "sinatra-activerecord"
gem "sinatra-contrib"
group :development do
gem "tux"
end
我的迁移文件:
我的Rakefile:
require "./app"
require "sinatra/activerecord/rake"
我不知道什么是Psych,我不使用这个宝石。我试图要求这个宝石,但这没有帮助。我该如何解决?