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

can't modify frozen string #2

Closed
inktvis75 opened this issue Sep 15, 2023 · 7 comments
Closed

can't modify frozen string #2

inktvis75 opened this issue Sep 15, 2023 · 7 comments
Assignees

Comments

@inktvis75
Copy link

I'll attempt to utilize your plugin, but regrettably, an error message has appeared:

jekyll 4.3.2 | Error: can't modify frozen String: ""
/Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/http-3.3.0/lib/http/response/body.rb:52:in `force_encoding': can't modify frozen String: "" (FrozenError)

Gemfile:
source "https://rubygems.org"
ruby "3.1.2"
gem "jekyll", "> 4.3.2"
gem "minima", "
> 2.5"
group :jekyll_plugins do
gem "jekyll-feed", "> 0.12"
gem "nokogiri"
gem "mastodon-api", "
> 2.0"
gem "jekyll-seo-tag"
end

@reiterate-app
Copy link
Owner

Can you give me the full stack trace? This is only showing an error in the http module outside of mastodon-social

@reiterate-app reiterate-app self-assigned this Sep 15, 2023
@inktvis75
Copy link
Author

/Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-api-2.0.0/lib/mastodon/rest/request.rb:13:in initialize': undefined method +' for nil:NilClass (NoMethodError)

    @uri            = Addressable::URI.parse(@client.base_url + path)
                                                              ^
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-api-2.0.0/lib/mastodon/rest/utils.rb:10:in `new'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-api-2.0.0/lib/mastodon/rest/utils.rb:10:in `perform_request'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-api-2.0.0/lib/mastodon/rest/utils.rb:18:in `perform_request_with_object'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-api-2.0.0/lib/mastodon/rest/apps.rb:17:in `create_app'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-social-0.1.0/lib/jekyll/commands/mastodon-social.rb:43:in `create_client_id'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-social-0.1.0/lib/jekyll/commands/mastodon-social.rb:22:in `block (2 levels) in init_with_program'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/exe/jekyll:15:in `<top (required)>'
from /Users/frederik/.rbenv/versions/3.1.2/bin/jekyll:25:in `load'
from /Users/frederik/.rbenv/versions/3.1.2/bin/jekyll:25:in `<main>'

@inktvis75
Copy link
Author

After reading about some issues in http, I upgraded this gem to version 5.1.1

jekyll mastodon setup
Configuration file: /Users/frederik/Library/CloudStorage/Dropbox/Projects/Recipes/vegdelicieus/_config.yml
jekyll 4.3.2 | Error: wrong number of arguments (given 2, expected 1)
/Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/http-5.1.1/lib/http/chainable.rb:93:in timeout': wrong number of arguments (given 2, expected 1) (ArgumentError) from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-api-2.0.0/lib/mastodon/rest/request.rb:37:in http_client'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-api-2.0.0/lib/mastodon/rest/request.rb:22:in perform' from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-api-2.0.0/lib/mastodon/rest/utils.rb:10:in perform_request'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-api-2.0.0/lib/mastodon/rest/utils.rb:18:in perform_request_with_object' from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-api-2.0.0/lib/mastodon/rest/apps.rb:17:in create_app'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-social-0.1.0/lib/jekyll/commands/mastodon-social.rb:43:in create_client_id' from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mastodon-social-0.1.0/lib/jekyll/commands/mastodon-social.rb:22:in block (2 levels) in init_with_program'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in block in execute' from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in each'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in execute' from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in go'
from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in program' from /Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll-4.3.2/exe/jekyll:15:in <top (required)>'
from /Users/frederik/.rbenv/versions/3.1.2/bin/jekyll:25:in load' from /Users/frederik/.rbenv/versions/3.1.2/bin/jekyll:25:in

'

@reiterate-app
Copy link
Owner

reiterate-app commented Sep 17, 2023

I'm using http 4.4.1 in my install and it's working fine, so I don't think you need 5.0.

I think the problem is that the mastodon-api gem hasn't been updated. That is, there's a newer version in GitHub that works with http 4.4+, but the author never published it to RubyGems, so if you just pull it in normally you get the old version.

The other confusing thing is that the newer version on GitHub is still labelled as 2.0.0.

Can you try changing your Gemfile to load mastodon-api directly from GitHub? You'll need to change the line in your Gemfile to something like

gem 'mastodon-api', :git => 'git://github.com/mastodon/mastodon-api.git'

mastodon/mastodon-api#57 (comment)

@inktvis75
Copy link
Author

Thank you!!
Working Gemfile:

source "https://rubygems.org"
ruby "3.1.2"
gem "jekyll", "> 4.3.2"
gem "minima", "
> 2.5"
group :jekyll_plugins do
gem "debug"
gem "http", "> 5.1.0"
gem "jekyll-feed", "
> 0.12"
gem "nokogiri"
gem "sass-embedded"
gem 'mastodon-api', :git => 'https://github.com/mastodon/mastodon-api.git'
gem "mastodon-social"
gem "jekyll-seo-tag"
end

@inktvis75
Copy link
Author

/Users/frederik/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/liquid-4.0.4/lib/liquid/block.rb:33:in `unknown_tag': Liquid syntax error (line 85): 'end_mastodon_social' is not a valid delimiter for mastodon_social tags. use endmastodon_social (Liquid::SyntaxError)

Typo in your documentation

@reiterate-app
Copy link
Owner

reiterate-app commented Sep 18, 2023

That's great, I'm glad it's working for you now! Thanks for the feedback. I will try opening an issue on mastodon-api to see if the author can push his latest GitHub changes to RubyGems mastodon/mastodon-api#57

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