我使用gem 'countries', require: 'iso3166'
当我尝试启动服务器时,出现以下错误:

rake aborted!

LoadError: cannot load such file -- iso3166
/home/davide/.rvm/gems/ruby-2.1.5@ekoodo/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `require'
/home/davide/.rvm/gems/ruby-2.1.5@ekoodo/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `block (2 levels) in require'
/home/davide/.rvm/gems/ruby-2.1.5@ekoodo/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
/home/davide/.rvm/gems/ruby-2.1.5@ekoodo/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
/home/davide/.rvm/gems/ruby-2.1.5@ekoodo/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
/home/davide/.rvm/gems/ruby-2.1.5@ekoodo/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
/home/davide/.rvm/gems/ruby-2.1.5@ekoodo/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
/home/davide/Desktop/app/koodos/config/application.rb:14:in `<top (required)>'
/home/davide/Desktop/app/koodos/Rakefile:4:in `require'
/home/davide/Desktop/app/koodos/Rakefile:4:in `<top (required)>'
/home/davide/.rvm/gems/ruby-2.1.5@ekoodo/bin/ruby_executable_hooks:15:in `eval'
/home/davide/.rvm/gems/ruby-2.1.5@ekoodo/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)

我又试着跑了一次,但没用。我在网上搜索类似的问题,但没有找到任何解决办法。
知道是什么导致了这个错误吗?

最佳答案

将其添加到gemfile中并再次打包

gem 'countries', :require => 'countries/global'

iso3166模块已经添加到gem本身。
您可以看到文档https://github.com/hexorx/countries

10-08 04:30