rake aborted! cannot load such file — indirizzo

情到浓时终转凉″ 提交于 2020-01-06 14:09:41

问题


I tried running rake db:reset in my rails application after bundle install. The following message is displayed

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 displays

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

回答1:


It seems to me the problem is in correct require. According to readme https://github.com/daveworth/Indirizzo#usage it should be

require 'Indirizzo'

but the fact that it does not work (the same error).

It think it should be the same as in the internal lib https://github.com/daveworth/Indirizzo/blob/master/lib/indirizzo.rb

require 'indirizzo/address'

after this I manage to complete this example Indirizzo::Address.new("some address")



来源:https://stackoverflow.com/questions/18713781/rake-aborted-cannot-load-such-file-indirizzo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!