gpt4 book ai didi

ruby - 加载错误 : no such file to load -- dm-sqlite-adapter

转载 作者:IT王子 更新时间:2023-10-29 06:20:59 24 4
gpt4 key购买 nike

我正在启动我的第一个 Sinatra 应用程序,我正在尝试使用 DataMapper。一切都处于非常早期的阶段,因为我无法真正创建数据库。当我尝试访问我的页面时,出现“LoadError:没有要加载的文件 -- dm-sqlite-adapter”。

到目前为止,这是我的 Sinatra 应用程序中的代码:

require 'rubygems'
require 'sinatra'
require 'dm-core'
require 'dm-timestamps'
# Also tried require 'datamapper' , but the same issue shows up

DataMapper::setup(:default, "sqlite3://#{Dir.pwd}/raffle.db")

class Raffle
include DataMapper::Resource

property :id, Serial
property :firstName, String
property :lastName, String
property :email, String
property :created_at, DateTime

end

# Create, upgrade, or migrate DB Tables
DataMapper.auto_upgrade!

我安装了 gem,作为 gem 列表输出:

*** LOCAL GEMS ***

activemodel (3.0.9, 3.0.3)
activerecord (3.0.9, 3.0.3)
activesupport (3.0.9, 3.0.3)
addressable (2.2.6)
arel (2.0.10, 2.0.4)
bcrypt-ruby (2.1.4)
builder (2.1.2)
bundler (1.0.15)
data_objects (0.10.6)
datamapper (1.1.0)
diff-lcs (1.1.2)
dm-aggregates (1.1.0)
dm-constraints (1.1.0)
dm-core (1.1.0)
dm-migrations (1.1.0)
dm-serializer (1.1.0)
dm-timestamps (1.1.0)
dm-transactions (1.1.0)
dm-types (1.1.0)
dm-validations (1.1.0)
do_sqlite3 (0.10.6)
fastercsv (1.5.4)
ffi (0.6.3)
i18n (0.5.0, 0.4.2)
json (1.5.3, 1.4.6)
mime-types (1.16)
rack (1.3.0, 1.2.1)
rack-test (0.5.6)
rake (0.8.7)
require_all (1.2.0)
rspec (2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
rspec-mocks (2.6.0)
shotgun (0.9)
sinatra (1.2.6, 1.1.0)
sqlite3 (0.1.1)
stringex (1.2.1)
tilt (1.3.2, 1.1)
typhoeus (0.2.4, 0.2.0)
tzinfo (0.3.29, 0.3.23)
uuidtools (2.1.2)

任何建议/见解总是值得赞赏的。

最佳答案

我没有看到 dm-sqlite-adapter该列表中的 gem 。尝试安装它。

关于ruby - 加载错误 : no such file to load -- dm-sqlite-adapter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6567372/

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