undefined method `reset_all` for nil - ruby

F
An error occurred in an `around(:example)` hook
NoMethodError: undefined method `reset_all' for nil:NilClass
occurred at /usr/lib/ruby/vendor_ruby/rspec/mocks.rb:22:in `teardown'
I'm currently trying to run a ruby test suite, but running into issues when calling rspec spec/. I'm getting the above traceback. Any ideas as to what might cause this? I've tried updating rspec to no avail.
Any debugging tips are also appreciated.

Looks like it was simply a matter of an outdated ruby version!

Related

possible to use rbenv with ruby2 to install ruby3?

I'm trying to get ruby3 on ubuntu20.04 (which I must use for policy compliance reasons) and only includes ruby up to 2.7
this version of ubuntu provides rbenv, and the list of available interpreters have rbx-3.0. When i try to install it i get
bundler-1.3.6/lib/bundler/fetcher.rb:240:in dependency_api_uri': undefined method encode' for URI:Module (NoMethodError)
not sure if the versions are related, but since the error i am getting (undefined method encode' for URI:Module`) is often caused by ruby 2 code running ruby 3, i'm guessing this is the source of my predicament.
Is there a work around for this? or a smarter way to go about getting ruby3 on this OS?

ruby package loaded but not functional

I've loaded a package in ruby but when I try to execute it, I get an error.
Please help!
Code:
require 'telegram/bot'
token = "REPLACE_WITH_ACTUAL_TOKEN"
Telegram::Bot::Client.run(token) do |bot|
end
Result:
undefined method `run' for Telegram::Bot::Client:Class (NoMethodError)
The error message is pretty self-explanatory:
undefined method `run' for Telegram::Bot::Client:Class (NoMethodError)
The error message is telling you that the method Telegram::Bot::Client::run does not exist, and both the documentation, the README, and the source code seem to agree that there is, indeed, no such method.
Issue here is not that your package is not loaded. But that class method run does not exist. You may want to check whether you have installed the latest version, not something old.
Other than that, I can hardly imagine what could be going on.

ruby : use credentials.yml.enc on heroku?

I'm new to the Ruby environment, and I wrote a ROR app that works fine locally.
I'm now trying to deploy it on Heroku, but it seems that it does not load my credentials.yml.enc, since the app crashes with a
undefined method `dig' for nil:NilClass (NoMethodError)
which is related to my line
Rails.application.credentials.odesli.dig(:api_key)
So it seems that Rails.application.credentials didn't load.
Any idea of how I have to handle this ?
Thanks.
it seems that I had to set the RAILS_MASTER_KEY var...
$ heroku config:set RAILS_MASTER_KEY=123456789

Ruby 'uuid'.strip NoMethodError (undefined method `strip' for nil:NilClass)

I am getting this error: NoMethodError (undefined method `strip' for nil:NilClass)
When I call:
`uuidgen`.strip
As I known it should generate an UUID. I would make different, but Rtex uses this to generate the pdf files and I can't change the code. So I think it must be something in my project configuration.
Does anyone have any idea?
As I found here: http://ruby.11.x6.nabble.com/Generating-a-unique-id-td2401970.html
The command between `` means that this is a shell command, then I tryed to execute in prompt: uuidgen and the SO did not recognize the command. After install Microsoft SDK, add uuidgen to the path and restart the enviroment, the command starts to works. I thing uuidgen is not native in Windows anymore.

Globalize2 problems, undefined method `translates' for?

I've set up Globalize2 on a rails app however I'm getting the following error when I put translates on the model:
undefined method `translates' for
Is anyone else getting this error? It's on rails 3 by the way.
You will have to use globalize3 if you run rails3.
You can download it from https://github.com/svenfuchs/globalize3 or by adding
gem "globalize3"
to you Gemfile and running bundle install.

Resources