country_select gem导致“在任何来源中找不到i18n_data-0.10.0".错误 [英] country_select gem causes "Could not find i18n_data-0.10.0 in any of the sources" error

查看:164
本文介绍了country_select gem导致“在任何来源中找不到i18n_data-0.10.0".错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用country_select宝石.我使用安装了它 gem install country_select -v 4.0,然后将其添加到我的gemfile的底部,运行捆绑安装,然后在尝试重新启动服务器时出现此错误:

I am trying to use the country_select gem. I installed it using gem install country_select -v 4.0, then I added it to the bottom of my gemfile, ran bundle install, and then when I tried to restart my server I got this error:

Could not find i18n_data-0.10.0 in any of the sources
Run `bundle install` to install missing gems.

我已经搜索了此错误,但没有找到其他遇到此问题的人,这里的任何帮助将不胜感激.

I have searched this error and haven't found anyone else with this problem -- any help here would be really appreciated.

这是我的gemfile:

Here is my gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.1'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.3'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '~> 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 2.15'
  gem 'selenium-webdriver'
  # Easy installation and use of web drivers to run system tests with browsers
  gem 'webdrivers'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

#country select gemfile
gem 'country_select', '~> 4.0'

捆绑安装返回以下内容:

bundle install returns the following:

The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Using rake 13.0.1
Using concurrent-ruby 1.1.7
Using i18n 1.8.5
Using minitest 5.14.2
Using thread_safe 0.3.6
Using tzinfo 1.2.7
Using zeitwerk 2.4.0
Using activesupport 6.0.3.3
Using builder 3.2.4
Using erubi 1.9.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.10
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.7.0
Using rails-html-sanitizer 1.3.0
Using actionview 6.0.3.3
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack 6.0.3.3
Using nio4r 2.5.3
Using websocket-extensions 0.1.5
Using websocket-driver 0.7.3
Using actioncable 6.0.3.3
Using globalid 0.4.2
Using activejob 6.0.3.3
Using activemodel 6.0.3.3
Using activerecord 6.0.3.3
Using mimemagic 0.3.5
Using marcel 0.3.3
Using activestorage 6.0.3.3
Using mini_mime 1.0.2
Using mail 2.7.1
Using actionmailbox 6.0.3.3
Using actionmailer 6.0.3.3
Using actiontext 6.0.3.3
Using public_suffix 4.0.6
Using addressable 2.7.0
Using bindex 0.8.1
Using msgpack 1.3.3
Using bootsnap 1.4.8
Using bundler 2.1.4
Using byebug 11.1.3
Using regexp_parser 1.7.1
Using xpath 3.2.0
Using capybara 3.33.0
Using childprocess 3.0.0
Using i18n_data 0.10.0
Using sixarm_ruby_unaccent 1.2.0
Using unicode_utils 1.4.0
Using countries 3.0.1
Using sort_alphabetical 1.1.0
Using country_select 4.0.0
Using ffi 1.13.1
Using jbuilder 2.10.1
Using rb-fsevent 0.10.4
Using rb-inotify 0.10.1
Using listen 3.2.1
Using method_source 1.0.0
Using pg 1.2.3
Using puma 4.3.6
Using rack-proxy 0.6.5
Using thor 1.0.1
Using railties 6.0.3.3
Using sprockets 4.0.2
Using sprockets-rails 3.2.2
Using rails 6.0.3.3
Using rubyzip 2.3.0
Using sassc 2.4.0
Using tilt 2.0.10
Using sassc-rails 2.1.2
Using sass-rails 6.0.0
Using selenium-webdriver 3.142.7
Using spring 2.1.1
Using spring-watcher-listen 2.0.1
Using turbolinks-source 5.2.0
Using turbolinks 5.2.1
Using web-console 4.0.4
Using webdrivers 4.4.1
Using webpacker 4.3.0
Bundle complete! 18 Gemfile dependencies, 80 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

推荐答案

在朋友的帮助下,我解决了这个问题.可能是由于我通过命令行下载了一个gem,然后将其添加到我的gemfile中导致了country_select gem的依赖关系出现了问题.

With the help of a friend I fixed this. It may have been caused by me downloading a gem via the command line and then adding it to my gemfile which caused a problem with my country_select gem's dependencies.

我尝试了很多方法来修复它,但不确定是什么解决了,所以这就是我所做的:

I tried many things to fix it, and I'm not sure what solved it, so here's what I did:

我删除了gemfile.lock并运行了捆绑安装程序,然后再次尝试了Rails服务器.这导致找不到其他文件.我尝试删除我的gemfile.lock并运行其他命令:捆绑包更新--all,捆绑包安装--redownload或捆绑包原始.每次,Rails服务器都不会启动服务器,因为它在任何来源中都找不到nio4r-2.5.4".

I deleted my gemfile.lock and ran bundle install and tried rails server again. This caused a different file to not be found. I tried deleting my gemfile.lock and running other commands: bundle update --all, bundle install --redownload, or bundle pristine. Each time, rails server wouldn't start the server because it 'could not find nio4r-2.5.4 in any of the sources'.

最后,我尝试运行"bundle exec rails服务器"然后它启动了服务器.但是,我的"rails test"命令仍然被打破.我想我需要添加"bundle exec"在我的rails命令保持一切正常之前.这可能是修复它的唯一原因.

Finally, I tried running "bundle exec rails server" and it started the server. However, my "rails test" command was still broken. I think I will need to add "bundle exec" before my rails commands for things to keep working. This may be the only thing that fixed it.

这篇关于country_select gem导致“在任何来源中找不到i18n_data-0.10.0".错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆