NoMethodError

54 views
Skip to first unread message

Danh Chu Cao

unread,
Mar 21, 2024, 7:26:38 AMMar 21
to RubyInstaller
Hi guys, i am getting started with Ruby. I just installed Ruby and the gem ceedling on my window 11. But when i run the first commned "ceedling" i got the trouble like this:

C:/Users/Admin/.local/share/gem/ruby/3.3.0/gems/ceedling-0.31.1/bin/ceedling:12:in `<top (required)>': undefined method `exists?' for class File (NoMethodError)

  project_found = File.exists?(main_filepath)
                      ^^^^^^^^
Did you mean?  exist?
        from C:/Users/Admin/AppData/Local/Microsoft/WindowsApps/ceedling:32:in `load'
        from C:/Users/Admin/AppData/Local/Microsoft/WindowsApps/ceedling:32:in `<main>'

I have kept searching for the error for almost 2 hours! Please help me how to fix that!
What should i do?

Thank you so much for your advices!

Grant Birchmeier

unread,
Mar 22, 2024, 1:23:27 AMMar 22
to rubyin...@googlegroups.com
Ah, I found it.  This is a ceedling problem, not a general ruby problem.

"File.exists?" was removed in ruby 3.2.0.  It had been marked as deprecated since 2.2.0, so people should have long ago stopped using it (if they paid proper attention to deprecations).  The ceedling maintainers were using it.

The latest ceedling gem was released in 2021, so the current version of Ruby at that time was 3.1.x or earlier.
(The rubygems page says that ceedling 0.31 is meant for Ruby >= 2.4.0, but clearly that needs an update.)

The ceedling crew have fixed it in their source repo, but have not yet released a new version.  Here's that fix:

So this sucks for you a little, because the steps to get you rolling aren't quite trivial for ruby noobs.

So, you have a few options:
* Install ruby 3.1.x and ceedling should work
* download the ceedling source and install that.  The latest ceedling might work fine with your ruby 3.2, or you could download ceedling 0.31 and just change File.exists? to File.exist?.

Maybe someone else has a better suggestion.

-Grant

--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyinstalle...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyinstaller/c688e948-ca84-4a8e-8046-24ed1705e0a6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages