Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't load in Ruby 3.0.0 #62

Open
mathieulb opened this issue Apr 26, 2021 · 7 comments
Open

Doesn't load in Ruby 3.0.0 #62

mathieulb opened this issue Apr 26, 2021 · 7 comments

Comments

@mathieulb
Copy link

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 `

'

@mathieulb
Copy link
Author

mathieulb commented Apr 26, 2021

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 **.

@apersaud
Copy link
Member

apersaud commented May 3, 2021

I'll take a look.

@apersaud
Copy link
Member

apersaud commented May 4, 2021

Can you give branch feature/1.10.0 a try?

PR: #64

@mathieulb
Copy link
Author

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

@apersaud
Copy link
Member

apersaud commented May 4, 2021

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'

@mathieulb
Copy link
Author

mathieulb commented May 8, 2021

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'

@mathieulb
Copy link
Author

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:
  • SHELL PATH:
    • /usr/local/opt/ruby/bin
    • /usr/local/lib/ruby/gems/3.0.0/bin
    • /usr/local/Cellar/python@3.9/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

jorgeacaballero pushed a commit to mobilecause/parse-stack that referenced this issue May 25, 2023
[modernistik#62] Separate positional and keyword arguments for Ruby 3.0

Replaces deprecated Proc.new usage

“warning: Capturing the given block using Proc.new is deprecated; use `&block` instead”

Remove upper bound for dependencies versions

Remove extra comma

remove dependence on AMS

ignore leading underscore

Updated dependencies

Updates version + dependencies

ruby 3.0 compatibility

fix block param

more ruby 3 compatibility

faraday 2 compatibility

Remove models overrides templates

Can't have two autoloaded files defining the same class. It results in
inconsistent behavior.
Built-in parse classes have to be properly reopened with class_eval.

compatibility with Rails strong parameters

update doc with reopening builtin classes

Removing dependencies for faraday_middleware

Bumping to 1.10.1

Bumping to 1.10.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants