Ich folge this Tutorial, aber ich habe ein Problem getroffen. Ich erhalte die Fehlermeldung:Ruby/Mongo: Warum erhalte ich nicht initialisierten MongoClient-Fehler?
server.rb:10:in `<main>': uninitialized constant Mongo::MongoClient (NameError)
ich die folgenden Edelsteine bin mit:
Using bson 4.1.1
Using bson_ext 1.5.1
Using daemons 1.2.3
Using eventmachine 1.2.0.1
Using rack 1.6.4
Using tilt 2.0.5
Using bundler 1.12.5
Using mongo 2.2.5
Using rack-protection 1.5.3
Using thin 1.7.0
Using sinatra 1.4.7
Mein Code:
require 'rubygems'
require 'bundler/setup'
require 'sinatra'
require 'json'
require 'mongo'
include Mongo
mongo_client = MongoClient.new("localhost", 27017)
ich das Mongo gem erforderlich habe und die Mongo Klasse enthalten sind. Warum wird MongoClient
nicht erkannt? Warum erhalte ich den Fehler?