gpt4 book ai didi

ruby - 无法使用 gem 添加源

转载 作者:数据小太阳 更新时间:2023-10-29 07:05:31 24 4
gpt4 key购买 nike

我正在尝试添加 http://rubygems.org/在我的源代码中,因为我无法使用“gem install NAME”(此错误:无法在任何存储库中找到有效的 gem“dashing”(>= 0))。

所以,我执行了这个命令:gem sources -a http://rubygems.org/

结果:错误:执行 gem 时 ... (Gem::OperationNotSupportedError) 未连接到 tty 且未指定默认值

我给你我的环境:

    $ 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

无源执行:gem 源

最佳答案

在这种情况下,我直接更改我的 Gem 配置文件。这是 ~/.gemrc 的更新版本:

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

验证方法如下:

$ gem sources
http://rubygems.org/

关于ruby - 无法使用 gem 添加源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36983442/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com