Skip to content

Commit

Permalink
Update tips with node error with 1.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Jul 29, 2012
1 parent 5f7b457 commit 4dd49b0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions en/mongoid/docs/tips.html
Expand Up @@ -97,10 +97,16 @@ <h1>Tips and FAQs</h1>
<section id='ruby'> <section id='ruby'>
<h2>Ruby 1.9.3</h2> <h2>Ruby 1.9.3</h2>
<p> <p>
Until 1.9.3, Ruby did not have a way to decode binary string data accurately Are you getting an error like the following?
for both big endian and little endian systems across all the data types used </p>
in the MongoDB wire protocol. All data sent via the wire protocol, as well <div class="CodeRay">
as the BSON specification itself use little endian and the ability to decode <div class="code"><pre><span class="constant">NoMethodError</span>: undefined method <span class="shell"><span class="delimiter">`</span><span class="content">[]' for nil:NilClass&#x000A; from /.rvm/gems/ruby-1.9.2-p290/gems/moped-1.1.0/lib/moped/node.rb:74:in </span><span class="delimiter">`</span></span>block <span class="keyword">in</span> command<span class="string"><span class="delimiter">'</span><span class="content">&#x000A; from /.rvm/gems/ruby-1.9.2-p290/gems/moped-1.1.0/lib/moped/node.rb:522:in `[]</span><span class="delimiter">'</span></span>&#x000A; from <span class="regexp"><span class="delimiter">/</span><span class="content">.rvm</span><span class="delimiter">/</span></span>gems/ruby-<span class="float">1.9</span>.<span class="error">2</span>-p290/gems/moped-<span class="float">1.1</span>.<span class="error">0</span>/lib/moped/node.rb:<span class="integer">522</span><span class="symbol">:in</span> <span class="shell"><span class="delimiter">`</span><span class="content">block (3 levels) in flush'&#x000A; from /.rvm/gems/ruby-1.9.2-p290/gems/moped-1.1.0/lib/moped/node.rb:521:in </span><span class="delimiter">`</span></span>map<span class="string"><span class="delimiter">'</span><span class="content">&#x000A; from /.rvm/gems/ruby-1.9.2-p290/gems/moped-1.1.0/lib/moped/node.rb:521:in `block (2 levels) in flush</span><span class="delimiter">'</span></span>&#x000A; from <span class="regexp"><span class="delimiter">/</span><span class="content">.rvm</span><span class="delimiter">/</span></span>gems/ruby-<span class="float">1.9</span>.<span class="error">2</span>-p290/gems/moped-<span class="float">1.1</span>.<span class="error">0</span>/lib/moped/node.rb:<span class="integer">113</span><span class="symbol">:in</span> <span class="shell"><span class="delimiter">`</span><span class="content">ensure_connected'&#x000A; from /.rvm/gems/ruby-1.9.2-p290/gems/moped-1.1.0/lib/moped/node.rb:517:in </span><span class="delimiter">`</span></span>block <span class="keyword">in</span> flush<span class="string"><span class="delimiter">'</span><span class="content">&#x000A;&#x000A;</span></span></pre></div>
</div>
<p>
If so, this is your issue. Until 1.9.3, Ruby did not have a way to decode binary
string data accurately for both big endian and little endian systems across all the
data types used in the MongoDB wire protocol. All data sent via the wire protocol,
as well as the BSON specification itself use little endian and the ability to decode
32 bit and 64 bit signed longs and ints did not arrive in Ruby until this 32 bit and 64 bit signed longs and ints did not arrive in Ruby until this
version. See <a href="http://ruby-doc.org/core-1.9.3/String.html#method-i-unpack"> version. See <a href="http://ruby-doc.org/core-1.9.3/String.html#method-i-unpack">
<code>String#unpack</code></a> and <code>String#unpack</code></a> and
Expand Down

0 comments on commit 4dd49b0

Please sign in to comment.