Rob
Rob

Reputation: 26

rake failure ruby 2.7.0 "undefined method extend_object for class Singleton

I'm attempting to install Ruby on Rails version 5.0.0 using Ruby 2.7.0 on Ubuntu. Executing any rake command (eg, "rake --tasks") results in a large number of messages about already initialized constants (Etc::VERSION, Etc::SC_AIO_LISTIO_MAX, etc.) followed by

rake aborted! 
NameError: undefined method `extend_object' for class `Singleton'
Did you mean?  extended

The answer to Error when running rake db:create: undefined method `extend_object' for class `Singleton' suggests removing Gemfile.lock and re-executing bundle install, but this had no effect for me. Are there other fixes?

Upvotes: 1

Views: 343

Answers (1)

RaghapBean
RaghapBean

Reputation: 11

I had the same problem today, updating ruby to 3.0.0 seems to solve this problem. Ubuntu for some reason downloads version 2.7.0, I used this article to help me install ruby 3.0.0

https://linoxide.com/how-to-install-ruby-on-ubuntu-20-04/

You will obviously also need to change the version in Gemfile and ruby-version file.

Upvotes: 1

Related Questions