parse-stack
parse-stack copied to clipboard
Doesn't load in Ruby 3.0.0
I have to use Ruby 2.6.3 (the one bundled with MacOS) instead of Ruby 3.0.0 (the one installable by Homebrew) because the latter causes this error:
/usr/local/lib/ruby/gems/3.0.0/gems/parse-stack-1.9.1/lib/parse/model/associations/has_many.rb:352:in `has_many_queried': wrong number of arguments (given 3, expected 1..2) (ArgumentError)
from /usr/local/lib/ruby/gems/3.0.0/gems/parse-stack-1.9.1/lib/parse/model/associations/has_many.rb:409:in `has_many'
from /usr/local/lib/ruby/gems/3.0.0/gems/parse-stack-1.9.1/lib/parse/model/classes/user.rb:182:in `<class:User>'
from /usr/local/lib/ruby/gems/3.0.0/gems/parse-stack-1.9.1/lib/parse/model/classes/user.rb:146:in `<module:Parse>'
from /usr/local/lib/ruby/gems/3.0.0/gems/parse-stack-1.9.1/lib/parse/model/classes/user.rb:6:in `<top (required)>'
from /usr/local/lib/ruby/gems/3.0.0/gems/parse-stack-1.9.1/lib/parse/model/classes/product.rb:4:in `require_relative'
from /usr/local/lib/ruby/gems/3.0.0/gems/parse-stack-1.9.1/lib/parse/model/classes/product.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/gems/3.0.0/gems/parse-stack-1.9.1/lib/parse/model/object.rb:567:in `require_relative'
from /usr/local/lib/ruby/gems/3.0.0/gems/parse-stack-1.9.1/lib/parse/model/object.rb:567:in `<top (required)>'
from /usr/local/lib/ruby/gems/3.0.0/gems/parse-stack-1.9.1/lib/parse/stack.rb:7:in `require_relative'
from /usr/local/lib/ruby/gems/3.0.0/gems/parse-stack-1.9.1/lib/parse/stack.rb:7:in `<top (required)>'
from <internal:/usr/local/Cellar/ruby/3.0.1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
from <internal:/usr/local/Cellar/ruby/3.0.1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
from <internal:/usr/local/Cellar/ruby/3.0.1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
from fetch.rb:6:in `<main>'
internal:/usr/local/Cellar/ruby/3.0.1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb:85:in require': cannot load such file -- parse/stack (LoadError) from <internal:/usr/local/Cellar/ruby/3.0.1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in require'
from fetch.rb:6:in `
This is fixable by inserting a ** to pass the options in parse/model/associations/has_many.rb:409 and parse/query.rb:769 ; this only covers my current usage, you'd have to find all cases of keyword-args being passed as a Hash and prefix them all with **.
I'll take a look.
Can you give branch feature/1.10.0 a try?
PR: https://github.com/modernistik/parse-stack/pull/64
did git clone https://github.com/modernistik/parse-stack.git -b feature/1.10.0 ;
then before my program's require I inserted the line $:.unshift ENV["HOME"]+"/parse-stack" ;
then I ran it using ruby 3.0.1 and it worked !
thanks
If you have a development environment, I suggest using the Gemfile to point to the new version:
gem 'parse-stack', git: 'https://github.com/modernistik/parse-stack.git', branch: 'feature/1.10.0'
i'm getting this error running the line from your last comment :
ruby -e "gem 'parse-stack', git: 'https://github.com/modernistik/parse-stack.git', branch: 'feature/1.10.0'"
/usr/local/Cellar/ruby/3.0.1/lib/ruby/3.0.0/rubygems/dependency.rb:311:in 'to_specs': Could not find 'parse-stack' (>= 0) among 205 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/biaptlab/.gem/ruby/3.0.0:/usr/local/lib/ruby/gems/3.0.0:/usr/local/Cellar/ruby/3.0.1/lib/ruby/gems/3.0.0' , execute 'gem env' for more information
from /usr/local/Cellar/ruby/3.0.1/lib/ruby/3.0.0/rubygems/dependency.rb:323:in 'to_spec'
from /usr/local/Cellar/ruby/3.0.1/lib/ruby/3.0.0/rubygems/core_ext/kernel_gem.rb:62:in 'gem'
Maybe I should have included this too, but I don't know enough about gem to know whether that's helpful. gem env RubyGems Environment:
- RUBYGEMS VERSION: 3.2.15
- RUBY VERSION: 3.0.1 (2021-04-05 patchlevel 64) [x86_64-darwin20]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/3.0.0
- USER INSTALLATION DIRECTORY: /Users/biaptlab/.gem/ruby/3.0.0
- RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/3.0.0/bin
- SPEC CACHE DIRECTORY: /Users/biaptlab/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/3.0.1/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-20
- GEM PATHS:
- /usr/local/lib/ruby/gems/3.0.0
- /Users/biaptlab/.gem/ruby/3.0.0
- /usr/local/Cellar/ruby/3.0.1/lib/ruby/gems/3.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/opt/ruby/bin
- /usr/local/lib/ruby/gems/3.0.0/bin
- /usr/local/Cellar/[email protected]/3.9.4/bin/
- /Users/biaptlab/bin
- /Users/biaptlab/Library/Android/sdk/tools
- /Users/biaptlab/Library/Android/sdk/platform-tools
- /Users/biaptlab/Library/Android/sdk/build-tools/30.0.2
- /Users/biaptlab/Library/Android/sdk/ndk-bundle/build
- /Library/Java/Home/bin
- /usr/local/share/dotnet
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/share/dotnet
- ~/.dotnet/tools
- /Library/Apple/usr/bin
- /Library/Frameworks/Mono.framework/Versions/Current/Commands