country_select gem 会导致"Could not find i18n_data-0.10.0 in any of the sources"错误



我正在尝试使用country_select gem。我使用安装了它gem install country_select -v 4.0,然后我把它添加到我的gemfile的底部,运行捆绑包安装,然后当我试图重新启动服务器时,我得到了这个错误:

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

我已经搜索了这个错误,还没有找到其他有这个问题的人——如果有任何帮助,我们将不胜感激。

这是我的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'

捆绑包安装返回以下内容:

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的依赖关系出现问题。

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

我删除了我的gemfile.lock并运行捆绑包安装,然后再次尝试rails服务器。这导致找不到其他文件。我试着删除我的gemfile.lock并运行其他命令:bundle update-all、bundle install-redownload或bundle pure。每次,rails服务器都不会启动服务器,因为它"在任何源中都找不到nio4r-2.5.4"。

最后,我试着跑步;bundle exec rails服务器";它启动了服务器。然而,我的";轨道测试";命令仍然被打破。我想我需要添加";bundle exec";在我的铁轨命令事情继续运转之前。这可能是唯一修复它的东西。

相关内容

最新更新