Search code examples
rubyrake

Rake error after gem update- The specified procedure could not be found(LoadError)


I updated Rubygems manually by running the setup.rb file.Since then , I am not able to start my application using rackup(I am not using rails. It's a standalone grape api mounted on rack). Getting the below error-

The specified procedure could not be found. - C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bigdecimal-1.4.3/lib/bigdecimal/util.so (LoadError)

I have checked the filepath mentioned in the error. util.so file exists on that exact filepath. Tried re installing the bigdecimal gem and also added bigdecimal to my gem file but does not help. Below is my code. It's quite simple and was working perfectly before I ran the update-

Dir["#{File.dirname(__FILE__)}/app/api/**/*.rb"].each { |f| require f }
module API
  class Root < Grape::API
    format :json
    prefix :api
    get :status do
    { status: 'ok' }
    end
  end
end
Application = Rack::Builder.new do
map "/" do
run API::Root
end
end

I am totally unable to run rackup on my system.Previously built APIs which were working perfectly are now failing with this error.Any suggestions to what I can do in this situation would be great help.Thanks!


Solution

  • When I uninstalled the bigdecimal gem, I got an error saying Ruby headers could not be found. So as a final resolution, I re-installed Ruby with Devkit (not sure if I had devkit in the previous installation) which solved my problem.