redis-stack / homebrew-redis-stack

4 stars 6 forks source link

Install fails with "undefined method `exists?' for class Dir" #45

Open Zer0-Tolerance opened 1 month ago

Zer0-Tolerance commented 1 month ago

Hi there, I'm trying to install Redis-stack but it fails with this error:

==> Downloading https://redismodules.s3.amazonaws.com/redis-stack/redis-stack-server-7.2.0-v10.
Already downloaded: /Users/phil/Library/Caches/Homebrew/downloads/233de96d05b20119de565d70e00318af8e5a7cac497d6248137041730192055e--redis-stack-server-7.2.0-v10.monterey.arm64.zip
Warning: Cannot verify integrity of '233de96d05b20119de565d70e00318af8e5a7cac497d6248137041730192055e--redis-stack-server-7.2.0-v10.monterey.arm64.zip'.
No checksum was provided.
For your reference, the checksum is:
  sha256 "bdd8ecb61f3619f898842d141d558b8c683767edce9874fd618a79a28cf68d64"
All dependencies satisfied.
==> Installing Cask redis-stack-server
==> Purging files for version 7.2.0-v10 of Cask redis-stack-server
Error: undefined method `exists?' for class Dir
/opt/homebrew/Library/Taps/redis-stack/homebrew-redis-stack/Casks/redis-stack-server.rb:59:in `block (2 levels) in load'
/opt/homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:47:in `instance_eval'
/opt/homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:47:in `abstract_phase'
/opt/homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:26:in `install_phase'
/opt/homebrew/Library/Homebrew/cask/installer.rb:248:in `block in install_artifacts'
/opt/homebrew/Library/Homebrew/cask/artifact_set.rb:10:in `each'
/opt/homebrew/Library/Homebrew/cask/artifact_set.rb:10:in `each'
/opt/homebrew/Library/Homebrew/cask/installer.rb:241:in `install_artifacts'
/opt/homebrew/Library/Homebrew/cask/installer.rb:113:in `install'
/opt/homebrew/Library/Homebrew/cmd/install.rb:246:in `block in run'
/opt/homebrew/Library/Homebrew/cmd/install.rb:235:in `each'
/opt/homebrew/Library/Homebrew/cmd/install.rb:235:in `run'
/opt/homebrew/Library/Homebrew/brew.rb:92:in `<main>'
If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/redis-stack/homebrew-redis-stack/issues/new

any idea why this is happening ?

schoon commented 1 month ago

For context, I have the same installation problem but i'm trying to install on a brand new macbook pro , Apple M3 Max, 36GB, Sonoma 14.3.1.

mattweston commented 1 month ago

Had the same problem today on mac, fixed by changing 3 (i think) instances of File.exists? to File.exist? and 1 instance of Dir.exists? to Dir.exist? in /usr/local/Homebrew/Library/Taps/redis-stack/homebrew-redis-stack/Casks/redis-stack-server.rb

mobydi commented 1 month ago

I have the same issue

john-ju commented 1 month ago

just ran into this and @mattweston suggestion fixed for me as well. just find where you installed redis-stack-server.rb and change .exists to .exist in the four places.

mine was located /opt/homebrew/Library/Taps/redis-stack/homebrew-redis-stack/Casks/redis-stack-server.rb

m-thomson commented 1 month ago

This fix worked for me as well, thanks @mattweston!

Just to add some clarity, the file you want to edit depends on whether you have an Intel or Apple Silicon (M series) Mac.

For Intel Macs, the file is: /usr/local/Homebrew/Library/Taps/redis-stack/homebrew-redis-stack/Casks/redis-stack-server.rb

For Apple Silicon Macs, the file is: /opt/homebrew/Library/Taps/redis-stack/homebrew-redis-stack/Casks/redis-stack-server.rb

Just replace all instances of .exists? with .exist? in that file. There should be four of them.

hstriepe3 commented 1 month ago

Apple M1, had to fix the exists into exist in the following file: open /opt/homebrew/Caskroom/redis-stack-server/.metadata/7.2.0-v10/20240404171843.440/Casks/redis-stack-server.rb

Extend-Apps commented 1 month ago

redis-stack-server.rb

This worked for me as well

logan-egbert commented 4 weeks ago

Apple M1, had to fix the exists into exist in the following file: open /opt/homebrew/Caskroom/redis-stack-server/.metadata/7.2.0-v10/20240404171843.440/Casks/redis-stack-server.rb

Apple M1 Pro, had to do this and was able to get this part of things working