我使用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
,但它没有帮助。我在网上搜索了类似的问题,但我找不到任何解决方案。
有关可能导致错误的原因的任何想法?
答案 0 :(得分:1)
在你的gemfile中添加它并再次捆绑
gem 'countries', :require => 'countries/global'
iso3166
模块已添加到gem本身。
答案 1 :(得分:0)
国家1.2.0及以上版本要求与之前不同的包含。由于您被锁定在1.2.5,请使用新的要求。
gem 'countries', :require => 'countries/global'
如果仍有问题,请运行bundle install
。