Ruby Bundler Authentication Error

岁酱吖の 提交于 2020-12-30 06:22:49

问题


I'm getting a strange error from bundler that I haven't seen before. On bundle install I get:

Please CGI escape your usernames and passwords before setting them for authentication

This only happens on one repo, and I suspect it has something to do with gem sources from github for a couple of gems in that gemfile. Worth noting, these gets are being pulling from git://github.com/, rather than SSH. Not sure if this might be what is causing the problem.

Couldn't find any information on this in Bundlers docs, so any insight or direction would be much appreciated.

Edit (Adding Gemfile):

ruby '2.2.2'


    # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
    gem 'rails', '>= 5.0.0.rc1', '< 5.1'
    # Use postgresql as the database for Active Record
    gem 'pg', '~> 0.18'
    # Use Puma as the app server
    gem 'puma', '~> 3.0'
    # Use SCSS for stylesheets
    gem 'sass-rails', '~> 5.0'
    gem 'bootstrap', '~> 4.0.0.alpha3'
    gem 'font-awesome-rails'
    # Use Uglifier as compressor for JavaScript assets
    gem 'uglifier', '>= 1.3.0'
    # Use CoffeeScript for .coffee assets and views
    gem 'coffee-rails', '~> 4.1.0'
    gem 'sprockets', '~> 3.0'
    # See https://github.com/rails/execjs#readme for more supported runtimes
    # gem 'therubyracer', platforms: :ruby

    # Use jquery as the JavaScript library
    gem 'jquery-rails'
    # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
    gem 'turbolinks', '~> 5.x'
    # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
    gem 'jbuilder', '~> 2.0'
    # Use Redis adapter to run Action Cable in production
    # gem 'redis', '~> 3.0'
    # Use ActiveModel has_secure_password
    # gem 'bcrypt', '~> 3.1.7'
    gem 'haml-rails'
    gem 'newrelic_rpm'
    gem 'httparty'
    gem 'gibbon'
    gem 'rollbar'

    gem 'rack-cors', :require => 'rack/cors'

    gem 'devise'
    gem 'trix'
    gem 'bootsy'
    gem 'paperclip'
    gem 'aws-sdk', '~> 2.3'
    gem 'figaro'
    gem 'simple_token_authentication'
    gem 'cancan'
    gem 'rolify'
    gem 'kaminari'
    gem 'twilio-ruby'

    gem 'rails_admin', github: 'sferik/rails_admin'
    gem 'rack-pjax', github: 'afcapel/rack-pjax', branch: 'master'
    #gem 'rails_admin'
    #gem 'rack-pjax'
    #gem 'remotipart', github: 'mshibuya/remotipart', ref: '3a6acb3'
    gem 'remotipart', '~> 1.3'
    gem 'active_model_serializers'

    group :development, :test do
      # Call 'byebug' anywhere in the code to stop execution and get a debugger console
      gem 'byebug', platform: :mri
      gem 'rubocop'
      gem 'annotate'
      gem 'letter_opener'
      gem 'pry'
      gem 'rspec-rails'
      gem 'shoulda-matchers'
    end

    group :development do
      # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
      gem 'web-console'
      gem 'listen', '~> 3.0.5'
      # 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'
      gem 'html2haml'
    end

The only value I have in bundle config is:

https://rubygems.org/ Set for the current user (/Users/jamesonknoll/.bundle/config): "https://rubygems.org/"

Adding gemfile.lock

GIT
  remote: git://github.com/afcapel/rack-pjax.git
  revision: c776a9a9eaa0641636e9ece5cfe88fc739339072
  branch: master
  specs:
    rack-pjax (0.8.0)
      nokogiri (>= 1.5)
      rack (>= 1.1)

GIT
  remote: git://github.com/sferik/rails_admin.git
  revision: cc8d5e64ee4c41387e422fec29afb3e579f5afab
  specs:
    rails_admin (1.1.0)
      builder (~> 3.1)
      coffee-rails (~> 4.0)
      font-awesome-rails (>= 3.0, < 5)
      haml (~> 4.0)
      jquery-rails (>= 3.0, < 5)
      jquery-ui-rails (~> 5.0)
      kaminari (~> 0.14)
      nested_form (~> 0.3)
      rack-pjax (>= 0.7)
      rails (>= 4.0, < 6)
      remotipart (~> 1.3)
      sass-rails (>= 4.0, < 6)

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.0.0)
      actionpack (= 5.0.0)
      nio4r (~> 1.2)
      websocket-driver (~> 0.6.1)
    actionmailer (5.0.0)
      actionpack (= 5.0.0)
      actionview (= 5.0.0)
      activejob (= 5.0.0)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.0.0)
      actionview (= 5.0.0)
      activesupport (= 5.0.0)
      rack (~> 2.0)
      rack-test (~> 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.0.0)
      activesupport (= 5.0.0)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    active_model_serializers (0.10.4)
      actionpack (>= 4.1, < 6)
      activemodel (>= 4.1, < 6)
      case_transform (>= 0.2)
      jsonapi (= 0.1.1.beta6)
    activejob (5.0.0)
      activesupport (= 5.0.0)
      globalid (>= 0.3.6)
    activemodel (5.0.0)
      activesupport (= 5.0.0)
    activerecord (5.0.0)
      activemodel (= 5.0.0)
      activesupport (= 5.0.0)
      arel (~> 7.0)
    activesupport (5.0.0)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (~> 0.7)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    addressable (2.4.0)
    annotate (2.7.1)
      activerecord (>= 3.2, < 6.0)
      rake (>= 10.4, < 12.0)
    arel (7.0.0)
    ast (2.3.0)
    autoprefixer-rails (6.3.7)
      execjs
    aws-sdk (2.3.21)
      aws-sdk-resources (= 2.3.21)
    aws-sdk-core (2.3.21)
      jmespath (~> 1.0)
    aws-sdk-resources (2.3.21)
      aws-sdk-core (= 2.3.21)
    bcrypt (3.1.11)
    bootstrap (4.0.0.alpha3)
      autoprefixer-rails (>= 6.0.3)
      sass (>= 3.4.19)
    bootsy (2.3.0)
      carrierwave (~> 0.11)
      mini_magick (~> 4.5)
    builder (3.2.2)
    byebug (9.0.5)
    cancan (1.6.10)
    carrierwave (0.11.2)
      activemodel (>= 3.2.0)
      activesupport (>= 3.2.0)
      json (>= 1.7)
      mime-types (>= 1.16)
      mimemagic (>= 0.3.0)
    case_transform (0.2)
      activesupport
    climate_control (0.0.3)
      activesupport (>= 3.0)
    cocaine (0.5.8)
      climate_control (>= 0.0.3, < 1.0)
    coderay (1.1.1)
    coffee-rails (4.1.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.1.x)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.10.0)
    concurrent-ruby (1.0.2)
    debug_inspector (0.0.2)
    devise (4.2.0)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0, < 5.1)
      responders
      warden (~> 1.2.3)
    diff-lcs (1.3)
    erubis (2.7.0)
    execjs (2.7.0)
    faraday (0.12.1)
      multipart-post (>= 1.2, < 3)
    ffi (1.9.13)
    figaro (1.1.1)
      thor (~> 0.14)
    font-awesome-rails (4.6.3.1)
      railties (>= 3.2, < 5.1)
    gibbon (3.0.2)
      faraday (>= 0.9.1)
      multi_json (>= 1.11.0)
    globalid (0.3.6)
      activesupport (>= 4.1.0)
    haml (4.0.7)
      tilt
    haml-rails (0.9.0)
      actionpack (>= 4.0.1)
      activesupport (>= 4.0.1)
      haml (>= 4.0.6, < 5.0)
      html2haml (>= 1.0.1)
      railties (>= 4.0.1)
    html2haml (2.0.0)
      erubis (~> 2.7.0)
      haml (~> 4.0.0)
      nokogiri (~> 1.6.0)
      ruby_parser (~> 3.5)
    httparty (0.14.0)
      multi_xml (>= 0.5.2)
    i18n (0.7.0)
    jbuilder (2.5.0)
      activesupport (>= 3.0.0, < 5.1)
      multi_json (~> 1.2)
    jmespath (1.3.0)
    jquery-rails (4.1.1)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (5.0.5)
      railties (>= 3.2.16)
    json (2.0.1)
    jsonapi (0.1.1.beta6)
      jsonapi-parser (= 0.1.1.beta3)
      jsonapi-renderer (= 0.1.1.beta1)
    jsonapi-parser (0.1.1.beta3)
    jsonapi-renderer (0.1.1.beta1)
    jwt (1.5.6)
    kaminari (0.17.0)
      actionpack (>= 3.0.0)
      activesupport (>= 3.0.0)
    launchy (2.4.3)
      addressable (~> 2.3)
    letter_opener (1.4.1)
      launchy (~> 2.2)
    libxml-ruby (3.0.0)
    listen (3.0.8)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.4)
      mime-types (>= 1.16, < 4)
    method_source (0.8.2)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mimemagic (0.3.1)
    mini_magick (4.5.1)
    mini_portile2 (2.1.0)
    minitest (5.9.0)
    multi_json (1.12.1)
    multi_xml (0.6.0)
    multipart-post (2.0.0)
    nested_form (0.3.2)
    newrelic_rpm (4.1.0.333)
    nio4r (1.2.1)
    nokogiri (1.6.8)
      mini_portile2 (~> 2.1.0)
      pkg-config (~> 1.1.7)
    orm_adapter (0.5.0)
    paperclip (5.0.0)
      activemodel (>= 4.2.0)
      activesupport (>= 4.2.0)
      cocaine (~> 0.5.5)
      mime-types
      mimemagic (~> 0.3.0)
    parser (2.3.1.2)
      ast (~> 2.2)
    pg (0.18.4)
    pkg-config (1.1.7)
    powerpack (0.1.1)
    pry (0.10.4)
      coderay (~> 1.1.0)
      method_source (~> 0.8.1)
      slop (~> 3.4)
    puma (3.4.0)
    rack (2.0.1)
    rack-cors (0.4.0)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (5.0.0)
      actioncable (= 5.0.0)
      actionmailer (= 5.0.0)
      actionpack (= 5.0.0)
      actionview (= 5.0.0)
      activejob (= 5.0.0)
      activemodel (= 5.0.0)
      activerecord (= 5.0.0)
      activesupport (= 5.0.0)
      bundler (>= 1.3.0, < 2.0)
      railties (= 5.0.0)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.1)
      activesupport (>= 4.2.0, < 6.0)
      nokogiri (~> 1.6.0)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    railties (5.0.0)
      actionpack (= 5.0.0)
      activesupport (= 5.0.0)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rainbow (2.1.0)
    rake (11.2.2)
    rb-fsevent (0.9.7)
    rb-inotify (0.9.7)
      ffi (>= 0.5.0)
    remotipart (1.3.1)
    responders (2.2.0)
      railties (>= 4.2.0, < 5.1)
    rolify (5.1.0)
    rollbar (2.15.1)
      multi_json
    rspec-core (3.5.4)
      rspec-support (~> 3.5.0)
    rspec-expectations (3.5.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.5.0)
    rspec-mocks (3.5.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.5.0)
    rspec-rails (3.5.1)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 3.5.0)
      rspec-expectations (~> 3.5.0)
      rspec-mocks (~> 3.5.0)
      rspec-support (~> 3.5.0)
    rspec-support (3.5.0)
    rubocop (0.41.2)
      parser (>= 2.3.1.1, < 3.0)
      powerpack (~> 0.1)
      rainbow (>= 1.99.1, < 3.0)
      ruby-progressbar (~> 1.7)
      unicode-display_width (~> 1.0, >= 1.0.1)
    ruby-progressbar (1.8.1)
    ruby_parser (3.8.2)
      sexp_processor (~> 4.1)
    sass (3.4.22)
    sass-rails (5.0.5)
      railties (>= 4.0.0, < 6)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sexp_processor (4.7.0)
    shoulda-matchers (3.1.1)
      activesupport (>= 4.0.0)
    simple_token_authentication (1.14.0)
      actionmailer (>= 3.2.6, < 6)
      actionpack (>= 3.2.6, < 6)
      devise (>= 3.2, < 6)
    slop (3.6.0)
    spring (1.7.2)
    spring-watcher-listen (2.0.0)
      listen (>= 2.7, < 4.0)
      spring (~> 1.2)
    sprockets (3.6.3)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.1.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (2.0.5)
    trix (0.9.7)
      rails
    turbolinks (5.0.0)
      turbolinks-source (~> 5)
    turbolinks-source (5.0.0)
    twilio-ruby (5.2.0)
      faraday (~> 0.9)
      jwt (~> 1.5)
      libxml-ruby (>= 2.0, < 4.0)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (3.0.0)
      execjs (>= 0.3.0, < 3)
    unicode-display_width (1.1.0)
    warden (1.2.6)
      rack (>= 1.0)
    web-console (3.3.1)
      actionview (>= 5.0)
      activemodel (>= 5.0)
      debug_inspector
      railties (>= 5.0)
    websocket-driver (0.6.4)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.2)

PLATFORMS
  ruby

DEPENDENCIES
  active_model_serializers
  annotate
  aws-sdk (~> 2.3)
  bootstrap (~> 4.0.0.alpha3)
  bootsy
  byebug
  cancan
  coffee-rails (~> 4.1.0)
  devise
  figaro
  font-awesome-rails
  gibbon
  haml-rails
  html2haml
  httparty
  jbuilder (~> 2.0)
  jquery-rails
  kaminari
  letter_opener
  listen (~> 3.0.5)
  newrelic_rpm
  paperclip
  pg (~> 0.18)
  pry
  puma (~> 3.0)
  rack-cors
  rack-pjax!
  rails (>= 5.0.0.rc1, < 5.1)
  rails_admin!
  remotipart (~> 1.3)
  rolify
  rollbar
  rspec-rails
  rubocop
  sass-rails (~> 5.0)
  shoulda-matchers
  simple_token_authentication
  spring
  spring-watcher-listen (~> 2.0.0)
  sprockets (~> 3.0)
  trix
  turbolinks (~> 5.x)
  twilio-ruby
  tzinfo-data
  uglifier (>= 1.3.0)
  web-console

RUBY VERSION
   ruby 2.2.2p95

BUNDLED WITH
   1.15.2

Current bundle --version is 1.16.1 Maybe that is causing the issue? But not sure why that would cause an auth error.


回答1:


check the output of

bundle config

if the output is something similar to below

Set for the current user (C:/Users/xxxxxx/.bundle/config): <user-name>:<password>

Probably the <password> is the culprit. check if it is CGI escaped.




回答2:


When I ran into this error, I had to edit my .bundle/config file

  • Ran: nano .bundle/config

Adjusted it to CGI escape.

I know this post is old, but hopefully it helps someone.




回答3:


This can happen when the line with the credentials in your ~/.bundle/config file has a trailing space.

You can tell this the case when the output of running bundle config includes a line like:

Set for the current user (/Users/jon/.bundle/config): "my_username:FAKEPASSWORDcFs6tdMp3SqGRYte8 "

Note the trailing space before the closing ".

Fix this by editing your ~/.bundle/config and removing any trailing spaces on the line with the credentials.



来源:https://stackoverflow.com/questions/49645957/ruby-bundler-authentication-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!