Railsアプリにgemの追加ができない問題に直面しています。
この件は別途質問を投稿していますが、今回はおそらくその件と関連するであろう別の問題を質問させていただきます。
Tera Termでvagrantにつないでrailsを起動しています。
$ gem sources
を確認すると、現在設定されているソースが何も表示されません。
普通はたぶんhttps://rubygems.org/とかが出るかと思います。
ただ、Gemfileを見ると
source 'https://rubygems.org'
と、しっかり書かれています。
コマンドプロンプトでアプリのあるディレクトリに行き、同様に
gem sources
を確認すると、ここでは
と出ます。
Tera Termでは空欄なので
$ gem sources --add https://rubygems.org/
を実行してソースを書き入れようとすると、
Error fetching https://rubygems.org/:
no such name (https://rubygems.org/specs.4.8.gz)
と出ます。
これってつまり、Tera Termで書いている方が何らかの問題でhttpsにつながっていないということだと思うのですが、根本原因は何なのでしょう?
コマンドプロンプトとTera Termの違いすらおぼつかない初心者ですが、解決のヒントをいただけると幸いです。
以下、追記
Vagrantfile
1 # Create a forwarded port mapping which allows access to a specific port 2 # within the machine from a port on the host machine. In the example below, 3 # accessing "localhost:8080" will access port 80 on the guest machine. 4 config.vm.network "forwarded_port", guest: 3000, host: 3000 5 6 # Create a private network, which allows host-only access to the machine 7 # using a specific IP. 8 config.vm.network "private_network", ip: "192.168.33.10" 9 10 # Create a public network, which generally matched to bridged network. 11 # Bridged networks make the machine appear as another physical device on 12 # your network. 13 # config.vm.network "public_network"
vagrant ssh
IP address for eth0: 10.0.2.15
IP address for eth1: 192.168.33.10
Last login: Mon Feb 11 22:47:17 2019 from 10.0.2.2
回答1件
あなたの回答
tips
プレビュー