I am running into an issue when trying to execute "rails test" on windows.
Issue:
17: from test/controllers/users_controller_test.rb:1:in `<main>'
16: from C:/Ruby25-x64/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
15: from C:/Ruby25-x64/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
14: from C:/Users/ES0074223/RubyOnRails/firefly/test/test_helper.rb:5:in `<top (required)>'
13: from C:/Users/ES0074223/RubyOnRails/firefly/test/test_helper.rb:6:in `<class:TestCase>'
12: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0.beta1/lib/active_support/test_case.rb:82:in `parallelize'
11: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0.beta1/lib/active_support/test_case.rb:82:in `new'
10: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0.beta1/lib/active_support/testing/parallelization.rb:54:in `initialize'
9: from C:/Ruby25-x64/lib/ruby/2.5.0/drb/drb.rb:1710:in `start_service'
8: from C:/Ruby25-x64/lib/ruby/2.5.0/drb/drb.rb:1710:in `new'
7: from C:/Ruby25-x64/lib/ruby/2.5.0/drb/drb.rb:1404:in `initialize'
6: from C:/Ruby25-x64/lib/ruby/2.5.0/drb/drb.rb:772:in `open_server'
5: from C:/Ruby25-x64/lib/ruby/2.5.0/drb/drb.rb:804:in `auto_load'
4: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0.beta1/lib/active_support/dependencies.rb:297:in `require'
3: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0.beta1/lib/active_support/dependencies.rb:263:in `load_dependency'
2: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0.beta1/lib/active_support/dependencies.rb:297:in `block in require'
1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0.beta1/lib/active_support/dependencies.rb:297:in `require'
C:/Ruby25-x64/lib/ruby/2.5.0/drb/unix.rb:6:in `<top (required)>': UNIXServer is required (LoadError)
Any help is much appreciated.
Might be related to Rails Issue #34410 Windows support for parallelization and instrumenter
Problem still exists today (end of nov 2019)
$ rails test
Traceback (most recent call last):
28: from bin/rails:9:in `<main>'
...
8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/testing/parallelization.rb:58:in `initialize'
7: from C:/Ruby26-x64/lib/ruby/2.6.0/drb/drb.rb:1715:in `start_service'
6: from C:/Ruby26-x64/lib/ruby/2.6.0/drb/drb.rb:1715:in `new'
5: from C:/Ruby26-x64/lib/ruby/2.6.0/drb/drb.rb:1403:in `initialize'
4: from C:/Ruby26-x64/lib/ruby/2.6.0/drb/drb.rb:772:in `open_server'
3: from C:/Ruby26-x64/lib/ruby/2.6.0/drb/drb.rb:804:in `auto_load'
2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:23:in `require'
1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:23:in `require'
C:/Ruby26-x64/lib/ruby/2.6.0/drb/unix.rb:6:in `<top (required)>': UNIXServer is required (LoadError)
The important part of the error messages was from testing/parallelization.rb.
In test/test_helper.rb: add "with threads":
parallelize(workers: :number_of_processors, with: :threads)
But this alone did not solve the problem. I also had
to upgrade sass-rails to version 6 (I had 5 before) in the Gemfile:
gem 'sass-rails', '>= 6'
and do a bundle update.
Why sass-rails is involved is a mystery.
From this article, it looks like this issue comes from the application using Unix sockets, which isn't supported on Windows.
I strongly suggest you run the application in Docker. This will solve your issues, but will -- of course -- not be a native windows experience.
Related
I have late 2013 MacBook Pro. Very good laptop to last me long time! My software was updated to MacOS Big Sur. Anyway, I haven't updated homebrew in a while and I was trying to updated it.
However, when I typed in brew outdated, I get this:
Traceback (most recent call last):
11: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>'
10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative'
9: from /usr/local/Homebrew/Library/Homebrew/global.rb:29:in `<top (required)>'
8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
6: from /usr/local/Homebrew/Library/Homebrew/os.rb:3:in `<top (required)>'
5: from /usr/local/Homebrew/Library/Homebrew/os.rb:21:in `<module:OS>'
4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:58:in `prerelease?'
3: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `version'
2: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `new'
1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:26:in `initialize'
/usr/local/Homebrew/Library/Homebrew/version.rb:368:in `initialize': Version value must be a string; got a NilClass () (TypeError)
and typing in brew update get this:
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
I don't know what's happening and what I should do. I tried looking up the problem but some of them are outdated or confusing.
Also when I typed in brew --version, I got this:
Traceback (most recent call last):
11: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>'
10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative'
9: from /usr/local/Homebrew/Library/Homebrew/global.rb:29:in `<top (required)>'
8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
6: from /usr/local/Homebrew/Library/Homebrew/os.rb:3:in `<top (required)>'
5: from /usr/local/Homebrew/Library/Homebrew/os.rb:21:in `<module:OS>'
4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:58:in `prerelease?'
3: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `version'
2: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `new'
1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:26:in `initialize'
/usr/local/Homebrew/Library/Homebrew/version.rb:368:in `initialize': Version value must be a string; got a NilClass () (TypeError)
Do I uninstall and start over again? Does it has something to do with my zsh shell that I'm using as the default version in my iTerm2? Or does it has something to do with slow internet connection?
I probably did some unwise things. After a brew update and a brew doctor kept throwing the same error, I tried to uninstall and reinstall it with the shell scripts for those. They mostly worked but upon reinstall, I got the same error bookended by the normal homebrew install output. So now in addition to losing homebrew itself, I've lost all the brew-installed tools. It's unclear what I've screwed up to cause this. Error output below:
Traceback (most recent call last):
15: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>'
14: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative'
13: from /usr/local/Homebrew/Library/Homebrew/global.rb:19:in `<top (required)>'
12: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/simple.rb:50:in `available_locales'
11: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/simple.rb:80:in `init_translations'
10: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/base.rb:18:in `load_translations'
9: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/base.rb:18:in `each'
8: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/base.rb:18:in `block in load_translations'
7: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/base.rb:226:in `load_file'
6: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/base.rb:243:in `load_yml'
5: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_1/lib/ruby/2.6.0/psych.rb:577:in `load_file'
4: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_1/lib/ruby/2.6.0/psych.rb:577:in `open'
3: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_1/lib/ruby/2.6.0/psych.rb:578:in `block in load_file'
2: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_1/lib/ruby/2.6.0/psych.rb:277:in `load'
1: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_1/lib/ruby/2.6.0/psych.rb:390:in `parse'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_1/lib/ruby/2.6.0/psych.rb:455:in `parse_stream': uninitialized constant Psych::Handlers (NameError)
10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>'
9: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative'
8: from /usr/local/Homebrew/Library/Homebrew/global.rb:19:in `<top (required)>'
7: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/simple.rb:50:in `available_locales'
6: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/simple.rb:80:in `init_translations'
5: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/base.rb:18:in `load_translations'
4: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/base.rb:18:in `each'
3: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/base.rb:18:in `block in load_translations'
2: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/base.rb:226:in `load_file'
1: from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/base.rb:241:in `load_yml'
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.3/lib/i18n/backend/base.rb:245:in `rescue in load_yml': can not load translations from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/locale/en.yml: #<NameError: uninitialized constant Psych::Handlers> (I18n::InvalidLocaleData)
Hope I am not too late for this thread, I have definitely seen this issue before.
Can you try the following two lines to see if it helps?
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_1/bin/gem update --system
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_1/bin/gem pristine --all
Worst case is you just need to remove ~/.gems, and brew would re-download the gem dependencies.
If would be great that you can attach your MacOS information.
I am trying to get Ruby on Rails working on my laptop and haven't been able to. At some point I took some bad advice and used sudo and have been trying to undo that error and the corresponding issues since.
As of right now, ruby -v shows
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
So, I think Ruby is installed. When I try to run gem install rails or any other gem command like gem install bundler, I get this error
Error loading RubyGems plugin "/Users/audreybrooke/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/rubygems_plugin.rb": cannot load such file -- executable-hooks/wrapper (LoadError)
Error loading RubyGems plugin "/Users/audreybrooke/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/gem-wrappers-1.4.0/lib/rubygems_plugin.rb": cannot load such file -- gem-wrappers (LoadError)
/Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
Traceback (most recent call last):
20: from /Users/audreybrooke/.rbenv/versions/2.7.1/bin/gem:21:in `<main>'
19: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/gem_runner.rb:44:in `run'
18: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/gem_runner.rb:79:in `do_configuration'
17: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/gem_runner.rb:79:in `new'
16: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/config_file.rb:182:in `initialize'
15: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/config_file.rb:332:in `load_file'
14: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems.rb:710:in `load_yaml'
13: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
12: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
11: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/yaml.rb:4:in `<top (required)>'
10: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
9: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
8: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/psych.rb:15:in `<top (required)>'
7: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
6: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
5: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/psych/nodes.rb:2:in `<top (required)>'
4: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
3: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
2: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/psych/nodes/node.rb:2:in `<top (required)>'
1: from /Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Users/audreybrooke/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': incompatible library version - /Users/audreybrooke/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/stringio-0.1.0/lib/stringio.bundle (LoadError)
It's because you have not installed libyaml correctly. Since you are using MacOS, maybe install it using homebrew can solve the problem.
brew install libyaml && brew link libyaml
I recommending to use rvm. It handle these like of dependency problems under the hood.
I did
sudo rm -rf ~/.rvm
because I had rvm and rbenv installed and that worked
We just upgraded a Rails app to 4.2 to 5.2, everything is working like a charm in development, but when we try to release the app on our production servers, we can't run any rails related commands (assets precompilation, migrate, console, etc.).
Here is the trace:
Traceback (most recent call last):
15: from bin/rails:4:in `<main>'
14: from bin/rails:4:in `require'
13: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
12: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke'
11: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform'
10: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
9: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
8: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
7: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands/console/console_command.rb:95:in `perform'
6: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
5: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/actions.rb:28:in `require_environment!'
4: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:337:in `require_environment!'
3: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:292:in `require'
2: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
1: from /var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require': failed to allocate memory (NoMemoryError)
We added puts file; just before the result = super in dependencies.rb:291, and a puts 'ERROR!' in the rescue in dependencies.rb#L260 and here are the last loaded files:
active_support/per_thread_registry
rack/runtime
rack/utils
active_support/cache/strategy/local_cache_middleware
rack/body_proxy
rack/utils
tzinfo/data
ERROR!
active_support/core_ext/time/zones
ERROR!
Traceback (most recent call last):
More information:
There is 52G of memory on the server, and we already tried adding 10G of SWAP.
Running htop is not giving any Memory leak
EDIT:
We tried removing the raise in dependencies.rb#L261 and of course the console loads, here are the logs:
rack/body_proxy
rack/utils
tzinfo/data
ERROR!
active_support/core_ext/time/zones
tzinfo/data/definitions/America/New_York
ERROR!
/var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/tzinfo-1.2.5/lib/tzinfo/ruby_data_source.rb:35: warning: constant ::Data is deprecated
/var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:396: warning: constant ::Data is deprecated
/var/deploy/slaask_kb/web_head/shared/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/inflector/methods.rb:283: warning: constant ::Data is deprecated
ERROR!
rails/console/app
active_support/all
action_controller
rails/console/helpers
active_record/base
pp
Loading production environment (Rails 5.2.3)
e2mmap
ERROR!
irb(main):001:0>
I was able to reproduce the issue on a development environment (Windows Subsystem for Linux) too.
We finally managed to solve it by upgrading tzinfo from 1.1 to 1.2.5, as suggested here: https://github.com/tzinfo/tzinfo/issues/30
i already try a lot o diferent way but cant solve this problem
.it seems that i cant install gems but i cant figure out why
already try with gem install bundler but steel doestn work
taller_integracion git:(develop) bundle install
Traceback (most recent call last):
7: from /Users/seba/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `<main>'
6: from /Users/seba/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `eval'
5: from /Users/seba/.rvm/gems/ruby-2.5.3/bin/bundle:23:in `<main>'
4: from /Users/seba/.rvm/gems/ruby-2.5.3/bin/bundle:23:in `load'
3: from /Users/seba/.rvm/gems/ruby-2.5.3/gems/bundler-0.9.26/bin/bundle:13:in `<top (required)>'
2: from /Users/seba/.rvm/gems/ruby-2.5.3/gems/bundler-0.9.26/lib/bundler/vendor/thor.rb:124:in `start'
1: from /Users/seba/.rvm/gems/ruby-2.5.3/gems/bundler-0.9.26/lib/bundler/vendor/thor/base.rb:377:in `start'
/Users/seba/.rvm/gems/ruby-2.5.3/gems/bundler-0.9.26/lib/bundler/vendor/thor/shell.rb:10:in `shell': uninitialized constant Thor::Base::Config (NameError)
and if i try with:
taller_integracion git:(develop) bundler install
Traceback (most recent call last):
10: from /Users/seba/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:10:in `<main>'
9: from /Users/seba/.rvm/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `run'
8: from /Users/seba/.rvm/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `each'
7: from /Users/seba/.rvm/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:50:in `block in run'
6: from /Users/seba/.rvm/gems/ruby-2.5.3#global/gems/rubygems-bundler-1.4.5/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
5: from /Users/seba/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:39:in `require'
4: from /Users/seba/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
3: from /Users/seba/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in `require'
2: from /Users/seba/.rvm/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:131:in `<top (required)>'
1: from /Users/seba/.rvm/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:124:in `check'
/Users/seba/.rvm/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:84:in `setup': undefined method `rubygems' for Bundler:Module (NoMethodError)
I faced this problem. I was working on a small project hence I just updated ruby version in gemfile to 2.6.3 and it worked for me.
create a new gemset with this ruby version and then run
gem install bundler
to install bundler with the latest ruby.
Now run
bundle install
if bundle install does not work then try
bundle update
this should do the trick.
If you are still facing the same issue then let me know.