简体   繁体   中英

How to create a new rails project with gems by proxy?

When I used rails new projectname to create a new rails project, it showed me

Gem::RemoteFetcher::FetchError: Errno::ECONNRESET: Connection reset by peer - SSL_connect ( https://rubygems.org/gems/debug_inspector-0.0.2.gem )

An error occurred while installing debug_inspector (0.0.2), and Bundler cannot continue.

Make sure that gem install debug_inspector -v '0.0.2' succeeds before bundling.

run bundle exec spring binstub --all

bundler: command not found: spring

Install missing gem executables with bundle install

Even I use gem install debug_inspector to install it, another gem need to be installed would show. It seems if I could connect the https://rubygems.org , the installation could succeed.

But I cannot connect it directly. I must use proxy software to connect.

I use Mac OS X and zsh.

How can I solve it?

Seems like your proxy doesn't support HTTPS protocol, so try to use HTTP instead of HTTPS. Specify it in Gemfile use source directive:

source 'http://rubygems.org'

Well, I use

export http_proxy=http://127.0.0.1:PROXY_PORT/
export https_proxy=http://127.0.0.1:PROXY_PORT/

and succeed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM