Ensure in require runtime error when setting up ruby on rails

Viewed 3324

I've been trying to set up ruby on rails.

I'd create a new project with

# rails new test

and I'd get this error message

Traceback (most recent call last):
    6: from /usr/bin/rails:23:in `<main>'
    5: from /usr/lib/ruby/2.7.0/rubygems.rb:295:in `activate_bin_path'
    4: from /usr/lib/ruby/2.7.0/rubygems.rb:295:in `synchronize'
    3: from /usr/lib/ruby/2.7.0/rubygems.rb:297:in `block in activate_bin_path'
    2: from /usr/lib/ruby/2.7.0/rubygems.rb:230:in `finish_resolve'
    1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:175:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:175:in `ensure in require': CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before false -> after true (RuntimeError)

I have been at for quite some time and I can't find a solution.

I've also made sure everything is updated with # gem update

And sorry if this is a simple problem, I am rather new to ruby on rails. I gather it might be a problem with the monitor package?

I'm running Linux with kernel 5.6.11-arch1-1 if that helps

2 Answers

Not sure if this is the same problem or not, but I had a similar error (not in Rails) and this page is the first that appears in Google, so I am posting a solution if someone else happens to land here.

For me, what solved it was to run:

$ gem clean

Try reinstalling the Bundler by using

gem install bundler

Then you can run

bundle install
Related