Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't add sources with gem

Tags:

ruby

rubygems

I'm trying to add http://rubygems.org/ in my sources because I can't use 'gem install NAME' (this error : Could not find a valid gem 'dashing' (>= 0) in any repository).

So, I did this command : gem sources -a http://rubygems.org/

the result : ERROR: While executing gem ... (Gem::OperationNotSupportedError) Not connected to a tty and no default specified

I give you my ENV :

    $ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.5.1
  - RUBY VERSION: 2.2.4 (2015-12-16 patchlevel 230) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0
  - RUBY EXECUTABLE: C:/RailsInstaller/Ruby2.2.0/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/RailsInstaller/Ruby2.2.0/bin
  - SPEC CACHE DIRECTORY: C:/Users/mramart/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0
     - C:/Users/mramart/.gem/ruby/2.2.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => []
  - REMOTE SOURCES:
  - SHELL PATH:
     - C:\Users\mramart\bin
     - C:\Program Files (x86)\Git\mingw32\bin
     - C:\Program Files (x86)\Git\usr\local\bin
     - C:\Program Files (x86)\Git\usr\bin
     - C:\Program Files (x86)\Git\usr\bin
     - C:\Program Files (x86)\Git\mingw32\bin
     - C:\Program Files (x86)\Git\usr\bin
     - C:\Users\mramart\bin
     - C:\RailsInstaller\Git\cmd
     - C:\RailsInstaller\Ruby2.2.0\bin
     - C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
     - C:\Tcl\bin
     - C:\ProgramData\Oracle\Java\javapath
     - C:\WINDOWS\system32
     - C:\WINDOWS
     - C:\WINDOWS\System32\Wbem
     - C:\WINDOWS\System32\WindowsPowerShell\v1.0
     - C:\WINDOWS\System32\WindowsPowerShell\v1.0
     - C:\Program Files (x86)\Lenovo\Access Connections
     - C:\Program Files\nodejs
     - C:\Program Files\Java\jdk1.7.0_79\bin
     - C:\Program Files (x86)\Heroku\bin
     - C:\Program Files (x86)\git\cmd
     - C:\Program Files\TortoiseSVN\bin
     - C:\Program Files\PostgreSQL\9.5\bin
     - C:\Program Files (x86)\scala\bin
     - D:\gatling-charts-highcharts-bundle-2.1.7\bin
     - C:\Program Files (x86)\sbt\bin
     - %USERPROFILE%\.dnx\bin
     - C:\Program Files\Microsoft DNX\Dnvm
     - C:\Program Files\Microsoft SQL Server\130\Tools\Binn
     - C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit
     - C:\Users\mramart\AppData\Roaming\npm
     - C:\Program Files\Java\jdk1.8.0_73\bin
     - C:\apache-maven-3.0.5\bin
     - C:\Program Files\PostgreSQL\9.5\bin
     - C:\Program Files\MongoDB\Server\3.2\bin
     - D:\liquid
     - C:\Users\mramart\AppData\Local\atom\bin
     - C:\Program Files (x86)\Git\usr\bin\vendor_perl
     - C:\Program Files (x86)\Git\usr\bin\core_perl

None sources executing : gem sources

like image 422
Raptor Jesus Avatar asked May 02 '16 13:05

Raptor Jesus


1 Answers

In such cases, I directly make changes to my Gem Config file. Here is an updated version of ~/.gemrc:

---
:backtrace: false
:bulk_threshold: 1000
:sources:
- http://rubygems.org
:update_sources: true
:verbose: true

Here's how to verify:

$ gem sources
http://rubygems.org/
like image 154
indieNik Avatar answered Nov 01 '22 08:11

indieNik