gpt4 book ai didi

mysql - DataMapper 无内存错误 - Sinatra

转载 作者:行者123 更新时间:2023-11-30 23:36:01 25 4
gpt4 key购买 nike

关于我在这里出错的地方有什么想法吗?

错误:

C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:291:in `next!': failed to allocate memory (NoMemoryError)
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:291:in `select_fields'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:39:in `select'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:276:in `with_connection'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:33:in `select'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/adapters/dm-mysql-adapter.rb:99:in `show_variable'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/adapters/dm-mysql-adapter.rb:89:in `character_set'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/adapters/dm-mysql-adapter.rb:54:in `create_table_statement'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/adapters/dm-do-adapter.rb:94:in `create_model_storage'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:276:in `with_connection'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/adapters/dm-do-adapter.rb:93:in `create_model_storage'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/adapters/dm-do-adapter.rb:57:in `upgrade_model_storage'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/auto_migration.rb:71:in `upgrade_model_storage'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/auto_migration.rb:143:in `auto_upgrade!'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/auto_migration.rb:45:in `send'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/auto_migration.rb:45:in `repository_execute'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/support/descendant_set.rb:66:in `each'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/support/subject_set.rb:212:in `each'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/support/ordered_set.rb:321:in `each'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/support/ordered_set.rb:321:in `each'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/support/subject_set.rb:212:in `each'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/support/descendant_set.rb:65:in `each'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/auto_migration.rb:44:in `repository_execute'
from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/auto_migration.rb:27:in `auto_upgrade!'
from list.rb:51

代码:

require 'rubygems'
require 'sinatra'
require 'omniauth/oauth'
require 'rest-graph'
require 'hashie/hash'
require 'dm-core'
require 'dm-serializer/to_json'
require 'dm-migrations'
require 'dm-timestamps'
require 'dm-validations'
require 'dm-mysql-adapter'

enable :sessions

APP_ID = "XXXXX"
APP_SECRET = "XXXX"

SQLCONN = "mysql://XXXXXXX"

DataMapper.setup(:default, SQLCONN)

class Person
include DataMapper::Resource

property :id, Serial
property :FBid, String
property :visits, Integer
property :first_visit, DateTime
property :recent_visit, DateTime
property :token, String

has n, :links
end

class Link
include DataMapper::Resource

property :id, Serial
property :created, DateTime
property :deactivated, DateTime
property :active, Boolean

belongs_to :person

def self.currentLinks
all(:active == true)
end
end

DataMapper.auto_upgrade!

最佳答案

all(:active == true)

尝试...

all(:active => true)

关于mysql - DataMapper 无内存错误 - Sinatra,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7312928/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com