轨道 gem 'countries' - 加载错误:无法加载此类文件 -- iso3166



我使用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)

我尝试再次运行bundle install,但没有帮助。我在网上搜索了类似的问题,但我找不到任何解决方案。

知道可能导致错误的原因吗?

将其添加到您的 gemfile 中并再次捆绑

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

iso3166模块已添加到 gem 本身。

您可以查看文档 https://github.com/hexorx/countries

国家/

地区 1.2.0 及更高版本需要与以前不同的包含。由于您被锁定在 1.2.5,请使用新的要求。

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

如果这仍然是一个问题,请运行bundle install

最新更新