Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Why still I see the bson_ext warning even though it is installed? #187

Closed
harunyasar opened this issue Sep 4, 2014 · 30 comments
Closed

Comments

@harunyasar
Copy link

Restart required
You have recently installed the bson_ext extension. Run genghisapp --kill then restart genghisapp to use it.

I restarted the app but it still shown. How can I avoid that message?

@bobthecow
Copy link
Owner

Are you running Genghis under RVM or rbenv? Are you running bundle exec genghis, or do you have some sort of shell or rbenv extension which does the equivalent?

@harunyasar
Copy link
Author

Under RVM. I'm running the app with "genghisapp" standalone.

@bobthecow
Copy link
Owner

When you restart, does it say 'genghisapp' is already running… or trying port 5678...?

@harunyasar
Copy link
Author

I have kill the process with "genghisapp --kill" then I restarted but not saying like you say. The output is below...
[2014-09-04 13:57:49 +0000] Starting 'genghisapp'...
[2014-09-04 13:57:49 +0000] trying port 5678...
Couldn't get a file descriptor referring to the console

@bobthecow
Copy link
Owner

Okay, so it's actually restarting and not just finding an old abandoned genghis instance that's already running.

What OS, OS version, and Ruby version are you running?

@bobthecow
Copy link
Owner

Run this in irb and let me know what it says:

require 'rubygems'
Gem::Specification.select { |s| s.name == 'mongo' }
Gem::Specification.select { |s| s.name == 'bson_ext' }

@harunyasar
Copy link
Author

Mac OS X Yosemite Beta 2
Version 2.3.11

@harunyasar
Copy link
Author

2.1.2 :001 > require 'rubygems'
 => false 
2.1.2 :002 > Gem::Specification.select { |s| s.name == 'mongo' }
 => [#<Gem::Specification:0x53587c mongo-1.9.2>] 
2.1.2 :003 > Gem::Specification.select { |s| s.name == 'bson_ext' }
 => [#<Gem::Specification:0x437da8 bson_ext-1.10.2>, #<Gem::Specification:0x346480 bson_ext-1.9.2>] 
2.1.2 :004 > 

@bobthecow
Copy link
Owner

(I added backticks to your comment so I could read the output)

@harunyasar
Copy link
Author

Ok :)

@bobthecow
Copy link
Owner

Uninstall bson_ext v1.10.2 and it should work. Mongo sometimes has a fit if the mongo driver version doesn't match the bson_ext version, and removing the other version would keep that from happening.

@bobthecow
Copy link
Owner

gem uninstall bson --version '> 1.10'
gem uninstall bson_ext --version '> 1.10'

@harunyasar
Copy link
Author

yes you're right. it is ok now. thanks for your help.

@bobthecow
Copy link
Owner

Great. I'll add a better message when the issue is version mismatch. Let's keep this issue open until I get around to that.

@cybertk
Copy link

cybertk commented Sep 6, 2014

gem uninstall bson --version '> 1.10'
gem uninstall bson_ext --version '> 1.10'

works

@BrandonZacharie
Copy link

I just had this issue again (ノಠ益ಠ)ノ. As mentioned above, one must have version parity with mongo and its dependencies. For those coming in from search, in short, your install may need to look something like:

> gem list | grep -w 'bson\|bson_ext\|mongo'
  bson (1.9.2)
  bson_ext (1.9.2)
  mongo (1.9.2)

what got me in to trouble was this:

> gem list | grep -w 'bson\|bson_ext\|mongo'
  bson (2.3.0, 1.10.2, 1.9.2)
  bson_ext (1.10.2, 1.9.2)
  mongo (1.10.2, 1.9.2)

...or I'm still derp, but the problem did go away along with the other versions. ʅʕ•ᴥ•ʔʃ

@bobthecow
Copy link
Owner

Ahh, yeah, having bson 2.3.0 is going to cause you issues. It's prolly installed on your system because of Mongoid/Moped? If you use Genghis with bundle exec and a Gemfile, it'll fix that.

@doughsay
Copy link

Sorry to dredge up the old issue, but I just got bitten by this.

The new message when running genghis is nice, ts told me exactly which version to install. Unfortunately I had already installed bson_ext without specifying the version because the output from the commandline from genghis did not include the version number.

It would have been nice if the console output also mentioned the version I needed. ;)

@guyskk
Copy link

guyskk commented Aug 18, 2015

Help me!

C:\Ruby22-x64\lib\ruby\gems\2.2.0\gems\genghisapp-2.3.11>gem list |find "bson"
bson (3.2.1, 1.9.2)
bson_ext (1.9.2)

C:\Ruby22-x64\lib\ruby\gems\2.2.0\gems\genghisapp-2.3.11>ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]

C:\Ruby22-x64\lib\ruby\gems\2.2.0\gems\genghisapp-2.3.11>genghisapp
C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in
require': cannot load such file -- win32/process (LoadError) from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_req uire.rb:55:inrequire'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/backports-3.6.6/lib/backport
s/std_lib.rb:9:in require_with_backports' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/vegas-0.1.11/lib/vegas/runne r.rb:8:in<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/genghisapp-2.3.11/bin/genghi
sapp:12:in <top (required)>' from C:/Ruby22-x64/bin/genghisapp:23:inload'
from C:/Ruby22-x64/bin/genghisapp:23:in `

'

@bobthecow
Copy link
Owner

@doughsay unfortunately that output is coming from the bson gem and there's not much we can do about it :(

maybe detect the issue ourselves and add a second message?

@bobthecow
Copy link
Owner

@guyskk you have the exact same issue. bson and bson_ext gems have to be the exact same versions, and you should only have one of them installed. uninstall all of 'em and start over :)

if you just install bson and start up genghis, the UI will show you the exact command to run to get the right version of bson_ext.

@guyskk
Copy link

guyskk commented Aug 18, 2015

I uninstall all bson, bson_ext, genghisapp, then install genghisapp,

C:\Users\kk>gem install genghisapp
Fetching: bson-1.9.2.gem (100%)
Successfully installed bson-1.9.2
Successfully installed genghisapp-2.3.11
Parsing documentation for bson-1.9.2
Installing ri documentation for bson-1.9.2
Parsing documentation for genghisapp-2.3.11
Done installing documentation for bson, genghisapp after 1 seconds
2 gems installed

C:\Users\kk>gem list |find "bson"
bson (3.2.1, 1.9.2)

but ...

C:\Users\kk>genghisapp
** Notice: The native BSON extension was not loaded. **

  For optimal performance, use of the BSON extension is recommended.

  To enable the extension make sure ENV['BSON_EXT_DISABLED'] is not set
  and run the following command:

    gem install bson_ext

  If you continue to receive this message after installing, make sure that
  the bson_ext gem is in your load path.

C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in
require': cannot load such file -- win32/process (LoadError) from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_req uire.rb:55:inrequire'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/backports-3.6.6/lib/backport
s/std_lib.rb:9:in require_with_backports' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/vegas-0.1.11/lib/vegas/runne r.rb:8:in<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/genghisapp-2.3.11/bin/genghi
sapp:12:in <top (required)>' from C:/Ruby22-x64/bin/genghisapp:23:inload'
from C:/Ruby22-x64/bin/genghisapp:23:in `

'

@guyskk
Copy link

guyskk commented Aug 18, 2015

uninstall bson 1.9.2

C:\Users\kk>gem uninstall bson --version 1.9.2

You have requested to uninstall the gem:
bson-1.9.2

mongo-1.9.2 depends on bson (~> 1.9.2)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] y
Remove executables:
b2json, j2bson

in addition to the gem? [Yn] y
Removing b2json
Removing j2bson
Successfully uninstalled bson-1.9.2

C:\Users\kk>gem list |find "bson"
bson (3.2.1)

C:\Users\kk>genghisapp
C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:313:in to_specs': Could not find 'bson' (~> 1.9.2) - did find: [bson-3.2.1] (Gem::LoadError) Checked in 'GEM_PATH=C:/Users/kk/.gem/ruby/2.2.0;C:/Ruby22-x64/lib/ruby/gems/2.2 .0', executegem envfor more information from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:13 17:inblock in activate_dependencies'
from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:13
06:in each' from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:13 06:inactivate_dependencies'
from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:12
88:in activate' from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:13 20:inblock in activate_dependencies'
from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:13
06:in each' from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:13 06:inactivate_dependencies'
from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:12
88:in activate' from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem .rb:54:ingem'
from C:/Ruby22-x64/bin/genghisapp:22:in `

'

@guyskk
Copy link

guyskk commented Aug 18, 2015

C:\Users\kk>gem list |find "mongo"
mongo (1.9.2)

C:\Users\kk>gem list |find "bson"
bson (1.9.2)
bson_ext (1.9.2)

C:\Users\kk>gem list |find "genghisapp"
genghisapp (2.3.11)

**still doesn't wrok ~~~**

C:\Users\kk>genghisapp
C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in
require': cannot load such file -- win32/process (LoadError) from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_req uire.rb:55:inrequire'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/backports-3.6.6/lib/backport
s/std_lib.rb:9:in require_with_backports' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/vegas-0.1.11/lib/vegas/runne r.rb:8:in<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/genghisapp-2.3.11/bin/genghi
sapp:12:in <top (required)>' from C:/Ruby22-x64/bin/genghisapp:23:inload'
from C:/Ruby22-x64/bin/genghisapp:23:in `

'

@bobthecow
Copy link
Owner

Oh! I didn't notice you're on Windows, and I was thrown by the two BSON versions, so I figured that was your issue.

Try running with genghisapp -F?

@guyskk
Copy link

guyskk commented Aug 18, 2015

error~~~

C:\Users\kk>genghisapp -F
C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in
require': cannot load such file -- win32/process (LoadError) from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_req uire.rb:55:inrequire'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/backports-3.6.6/lib/backport
s/std_lib.rb:9:in require_with_backports' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/vegas-0.1.11/lib/vegas/runne r.rb:8:in<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/genghisapp-2.3.11/bin/genghi
sapp:12:in <top (required)>' from C:/Ruby22-x64/bin/genghisapp:23:inload'
from C:/Ruby22-x64/bin/genghisapp:23:in `

'

C:\Users\kk>gem list | find "bson"
bson (1.9.2)
bson_ext (1.9.2)

@bobthecow
Copy link
Owner

Yeah, this is likely windows process control related, not BSON related. That's what the -F flag was supposed to fix :(

@guyskk
Copy link

guyskk commented Aug 18, 2015

Keep on going!
:)

@Zhomart
Copy link

Zhomart commented Jan 27, 2016

I had these issue on freshly installed genghis. I did following to fix:

$ gem install specific_install
$ gem specific_install -l https://github.com/bobthecow/genghis

# uninstall all versions of mongo, bson and bson_ext
$ gem uninstall mongo bson bson_ext
$ gem install mongo -v "1.9.2"
$ gem install bson_ext -v "1.9.2"

$ genghisapp
[2016-01-26 20:21:47 -0800] Starting 'genghisapp'...
[2016-01-26 20:21:47 -0800] trying port 5678...
$

If you have newer version of mongo than 1.9.2, genghis loads it as described in file src/rb/genghis/helpers.rb:64

installed = Gem::Specification.find_all { |s| s.name == 'mongo' }.map { |s| s.version }.sort.last

@harunyasar
Copy link
Author

Thanks for your help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants