[英]rails gem 'countries' - LoadError: cannot load such file -- iso3166
I use gem 'countries', require: 'iso3166'
.我使用
gem 'countries', require: 'iso3166'
。
When I try to start the server I got this error:当我尝试启动服务器时出现此错误:
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)
I tried running bundle install
again, but it didn't help.我尝试再次运行
bundle install
,但没有帮助。 I searched the web for similar problem but I dind't find any solution.我在网上搜索了类似的问题,但没有找到任何解决方案。
Any idea about what might cause the error?知道什么可能导致错误吗?
Add this in your gemfile and bundle it again将此添加到您的 gemfile 中并再次捆绑它
gem 'countries', :require => 'countries/global'
iso3166
module already added to the gem itself. iso3166
模块已添加到 gem 本身。
you can see documentation https://github.com/hexorx/countries你可以看到文档https://github.com/hexorx/countries
Countries 1.2.0 and above requires a different include than previously. 1.2.0 及更高版本的国家/地区需要与以前不同的包含。 Since you are locked at 1.2.5, use the new require.
由于您被锁定在 1.2.5,因此请使用新的 require。
gem 'countries', :require => 'countries/global'
If that is still an issue, run bundle install
.如果这仍然是一个问题,请运行
bundle install
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.