错误包安装 - ArgumentError - bcrypt

Error Bundle Install - ArgumentError - bcrypt

每当我尝试 运行 bundle install 时,我都会遇到 2 个问题:


我已经试过了:

gem uninstall bundler
gem install bundler -v 1.16.0

gem uninstall bcrypt
gem install bcrypt

gem uninstall rake
gem install rake -v '12.0.0'

这是我的控制台输出:

$ bundle install
The dependency bcrypt (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for x86-mingw32 but the dependency is only for ruby. To add those platforms to the bundle, run `bundle lock --add-platform ruby`.
Fetching gem metadata from https://rails-assets.org/...
Fetching gem metadata from https://rails-assets.org/..
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rails-assets.org/..
Fetching gem metadata from https://rails-assets.org/..
Fetching gem metadata from https://rubygems.org/...
Fetching gem metadata from https://rails-assets.org/..
Fetching gem metadata from https://rails-assets.org/..
Fetching gem metadata from https://rubygems.org/...
Resolving dependencies...
Using rake 12.0.0
ArgumentError: can't find user 22%
An error occurred while installing rake (12.0.0), and Bundler cannot continue.
Make sure that `gem install rake -v '12.0.0'` succeeds before bundling.

In Gemfile:
  coffee-rails was resolved to 4.2.2, which depends on
    railties was resolved to 5.1.3, which depends on
      rake

我的包环境:

$ bundle env
c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler.rb:379:in `expand_path': can't find user 22% (ArgumentError)
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler.rb:379:in `block in which'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler.rb:377:in `each'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler.rb:377:in `find'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler.rb:377:in `which'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler.rb:452:in `git_present?'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/source/git/git_proxy.rb:57:in `initialize'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/env.rb:84:in `new'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/env.rb:84:in `git_version'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/env.rb:119:in `environment'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/env.rb:17:in `report'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:96:in `request_issue_report_for'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:46:in `log_error'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:126:in `rescue in with_friendly_errors'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:122:in `with_friendly_errors'
        from c:/Rails/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/exe/bundle:22:in `<top (required)>'
        from c:/Rails/RailsInstaller/Ruby2.3.3/bin/bundle:22:in `load'
        from c:/Rails/RailsInstaller/Ruby2.3.3/bin/bundle:22:in `<main>'

我的 Gemfile

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end

gem 'rails', '~> 5.1.2'
gem 'sqlite3'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'jquery-rails'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'coffee-script-source', '1.8.0'
gem 'rake', '~> 12.0.0'

group :development, :test do
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
end

group :development do
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '~> 3.0.5'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'bootstrap-sass', '~> 3.3.6'
gem 'devise', '~> 4.2'
gem 'font-awesome-rails', '~> 4.7', '>= 4.7.0.2'
gem 'wdm', '>= 0.1.0'
gem 'toastr-rails', '~> 1.0'

gem 'omniauth', '~> 1.6'
gem 'omniauth-facebook', '~> 4.0'
gem 'omniauth-google-oauth2', '~> 0.4.1'

gem 'paperclip', '~> 5.1.0'

gem 'bcrypt', platforms: :ruby

gem 'geocoder', '~> 1.4'
gem 'jquery-ui-rails', '~> 5.0'

gem 'ransack', '~>1.7'

gem 'twilio-ruby', '~> 4.11.1'
gem 'fullcalendar-rails','~> 3.4.0'
gem 'momentjs-rails', '~> 2.17.1'

gem 'stripe', '~> 3.0.0'
gem 'rails-assets-card', source: 'https://rails-assets.org'

gem 'omniauth-stripe-connect', '~> 2.10.0'

gem 'chartkick', '~> 2.2.4'

我认为您的部分问题可能是由于最近在 ruby​​gems 中引入的一个问题。参见 https://github.com/rubygems/rubygems/issues/2064

看起来好像刚刚提交了修复,但当前的解决方案是降级到较早版本的 ruby​​gems。