在 Rails 4 中安装 mongoid gem

Install mongoid gem in Rails 4

我正在尝试在 these instructions 之后的 Rails 4 中安装 mongoid gem(google 上的第一个 link,以及其他说明说同样的话)。

将以下行添加到我的 Gemfile 和 运行 bundle install

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

这会产生一个错误:

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.

mongoid/mongoid GitHub repository says it has moved to mongodb/mongoid。但是将 gem 行更改为 github: 'mongodb/mongoid' 并不能解决问题。

我是不是漏掉了什么明显的东西?

连接被拒绝错误可能意味着您位于阻止 git 协议端口的防火墙后面,使用 https:443 可能您的防火墙允许

您可以使用类似

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