我将 DataMapper gem 与 Sinatra 一起使用,并按照此处的教程进行操作:http: //net.tutsplus.com/tutorials/ruby/ruby-for-newbies-working-with-datamapper/
我正在连接到数据库并进行迁移:
DataMapper.setup :default, "sqlite://#{Dir.pwd}/ex2.db"
DataMapper.auto_migrate!
我的数据模型:
class User
include DataMapper::Resource
property :id , Serial
property :username , String
property :email , String
end
我正在使用这个命令执行:
rackup config.ru
但是,当我到达这一行时:
User.create username: "JoeSchmo", email: "joe@schmo.com"
我收到错误:
Rack::Lint::LintError: Status must be >=100 seen as integer
知道为什么会这样吗?