使用DataMapper的Ruby问题“不推荐使用带参数的DataObjects :: URI.new ......”

时间:2011-06-26 17:03:20

标签: ruby datamapper

在datamapper 1.1.0中初始化字符串时

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

我在Data Mapper中收到以下错误:

DataObjects:: URI.new with arguments is deprecated, use a Hash of URI components 

(C: / Ruby192/lib/ruby/gems/1.9.1/gems/dm-do-adapter-1.1.0/lib/dm-do -adapter/adapter.rb: 231: in `new ')

为什么会这样?

1 个答案:

答案 0 :(得分:3)

在此提交https://github.com/snaggled/dm-do-adapter/commit/d674255fae9ba6e9269290626cf97579d3b7a88d

中修复了github

您可以在补丁中手动将其应用到C:/Ruby192/lib/ruby/gems/1.9.1/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb

- 或(不确定这是否适用于Windows) -

gem install bundler

git clone git://github.com/snaggled/dm-do-adapter.git
cd dm-do-adapter
Edit Gemfile and replace 'http://' with 'git://'
bundle
rake build
gem install pkg/dm-do-adapter-1.1.1.gem