0

捆绑安装后,我尝试rake db:reset在我的 Rails 应用程序中运行。显示以下消息

rake aborted!
cannot load such file -- indirizzo
/home/xyz/Desktop/Signup4/app/models/concerns/address_validation.rb:2:in `<module:AddressValidation>'
/home/xyz/Desktop/Signup4/app/models/concerns/address_validation.rb:1:in `<top (required)>'
/home/xyz/Desktop/Signup4/app/models/location.rb:2:in `<class:Location>'
/home/xyz/Desktop/Signup4/app/models/location.rb:1:in `<top (required)>'
/home/xyz/Desktop/Signup4/db/seeds.rb:11:in `<top (required)>'
Tasks: TOP => db:setup => db:seed
(See full trace by running task with --trace)

bundle show Indirizzo显示

/usr/local/lib/ruby/gems/2.0.0/gems/Indirizzo-0.1.7
4

1 回答 1

2

在我看来问题是正确的require。根据自述文件https://github.com/daveworth/Indirizzo#usage它应该是

require 'Indirizzo'

但它不起作用的事实(同样的错误)。

它认为它应该与内部库中的相同https://github.com/daveworth/Indirizzo/blob/master/lib/indirizzo.rb

require 'indirizzo/address'

在此之后我设法完成了这个例子Indirizzo::Address.new("some address")

于 2013-09-10T08:52:30.677 回答