我正在使用Sinatra和DataMapper在单个POST
请求后向同一数据库中的多个表添加一些行。
我遇到的问题是这在本地工作得很好,但在使用Apache和Phusion Passenger的测试服务器上却没有。。在测试服务器上,表单完全正常并且不会抛出错误,但是只创建了3个新记录中的第一个(在此示例中,将创建用户,但不创建订单或帖子)
我的代码是:
post '/new/quote/guest' do
g = User.new
# Add some stuff to the Users table
g.save
guestorder = Order.new
# Do some stuff to the Orders table
guestorder.save
i = Post.new
Do some stuff to the Posts table
i.save
end
在两台服务器上,我使用相同版本的Ruby,rvm和所有宝石。唯一的区别是测试服务器使用Passenger + Apache服务此应用程序。