简体   繁体   中英

Install mongoid gem in Rails 4

I'm trying to install mongoid gem in Rails 4 following these instructions (first link on google, and other instructions say the same thing).

Added the following lines to my Gemfile and ran bundle install .

gem 'mongoid', '~> 4', github: 'mongoid/mongoid'
gem 'bson_ext'

This yields an error:

Fetching git://github.com/mongoid/mongoid.git
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=Connection refused

Retrying git clone 'git://github.com/mongoid/mongoid.git' "/home/mike/.bundler/cache/git/mongoid-176c799a8a4589043b073e277e545d697119fa82" --bare --no-hardlinks --quiet due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git://github.com/mongoid/mongoid.git' "/home/mike/.bundler/cache/git/mongoid-176c799a8a4589043b073e277e545d697119fa82" --bare --no-hardlinks --quiet` in directory /home/mike/shares has failed.

The mongoid/mongoid GitHub repository says it has moved to mongodb/mongoid . But changing gem line to github: 'mongodb/mongoid' does not fix the issue.

Am I missing something obvious here?

The connection refused error probably means that you are behind a firewall that blocks the git protocol port , using https:443 probably your firewall allows

You can use something like,

gem 'mongoid', :git => 'https://github.com/mongodb/mongoid.git'

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