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

Import blogger command fails with undefined method 'decode' for URI:Module (NoMethodError) #509

Closed
sproctor opened this issue Feb 19, 2023 · 11 comments · Fixed by #517
Closed

Comments

@sproctor
Copy link

Command:

$ jekyll import blogger --source blog-02-19-2023.xml --no-blogger-info --replace-internal-link --comments 
jekyll 4.3.2 | Error:  Whoops, we can't understand your command.
jekyll 4.3.2 | Error:  invalid option: --no-blogger-info
jekyll 4.3.2 | Error:  Run your command again with the --help switch to see available options.
/home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.2.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:33:in `go': invalid option: --no-blogger-info (OptionParser::InvalidOption)
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.2.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.2.0/gems/jekyll-4.3.2/exe/jekyll:15:in `<top (required)>'
	from /home/sproctor/.rvm/gems/ruby-3.2.0/bin/jekyll:25:in `load'
	from /home/sproctor/.rvm/gems/ruby-3.2.0/bin/jekyll:25:in `<main>'
	from /home/sproctor/.rvm/gems/ruby-3.2.0/bin/ruby_executable_hooks:22:in `eval'
	from /home/sproctor/.rvm/gems/ruby-3.2.0/bin/ruby_executable_hooks:22:in `<main>'
@sproctor
Copy link
Author

It's a bit more complicated. Removing the command line options reveals that it needs jekyll-import. After installing that, I still get the message:

You must install the 'jekyll-import' gem version > 0 to use the 'jekyll import' command.

I have jekyll-import 0.21.0 installed.

@ashmaroli

This comment was marked as resolved.

@sproctor

This comment was marked as resolved.

@sproctor

This comment was marked as resolved.

@ashmaroli

This comment was marked as resolved.

@sproctor

This comment was marked as resolved.

@ashmaroli

This comment was marked as resolved.

@sproctor

This comment was marked as resolved.

@sproctor

This comment was marked as resolved.

@ashmaroli

This comment was marked as resolved.

@sproctor
Copy link
Author

RVM is weird. It seems to do some really weird things. I'm sorry that I'm mixing a few different strategies at once here. I installed ruby 3.1, and put the dependencies into the Gemfile. This seems to have at least gotten me past the above issue. If you still want to investigate that one, I'm happy to help, but I've found a way around it. Unfortunately, I'm still getting an error, but it looks much more obvious:

$ bundle exec jekyll import blogger --source blog-02-19-2023.xml --no-blogger-info --replace-internal-link --comments
jekyll 4.3.2 | Error:  undefined method `decode' for URI:Module

                file_name = URI.decode("#{post_data[:filename]}.html")
                               ^^^^^^^
/home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/jekyll-import-0.21.0/lib/jekyll-import/importers/blogger.rb:197:in `tag_end': undefined method `decode' for URI:Module (NoMethodError)

                file_name = URI.decode("#{post_data[:filename]}.html")
                               ^^^^^^^
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/rexml-3.2.5/lib/rexml/parsers/streamparser.rb:36:in `parse'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/jekyll-import-0.21.0/lib/jekyll-import/importers/blogger.rb:47:in `block in process'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/jekyll-import-0.21.0/lib/jekyll-import/importers/blogger.rb:45:in `open'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/jekyll-import-0.21.0/lib/jekyll-import/importers/blogger.rb:45:in `process'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/jekyll-import-0.21.0/lib/jekyll-import/importer.rb:25:in `run'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/jekyll-import-0.21.0/lib/jekyll-import.rb:30:in `block (3 levels) in add_importer_commands'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/gems/jekyll-4.3.2/exe/jekyll:15:in `<top (required)>'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `load'
	from /home/sproctor/code/php-calendar.org/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `<main>'
	from /home/sproctor/.rvm/gems/ruby-3.1.3/bin/ruby_executable_hooks:22:in `eval'
	from /home/sproctor/.rvm/gems/ruby-3.1.3/bin/ruby_executable_hooks:22:in `<main>'

@ashmaroli ashmaroli changed the title Import blogger command fails with "invalid option" message Import blogger command fails with undefined method decode' for URI:Module (NoMethodError)` Feb 19, 2023
@ashmaroli ashmaroli changed the title Import blogger command fails with undefined method decode' for URI:Module (NoMethodError)` Import blogger command fails with undefined method 'decode' for URI:Module (NoMethodError) Feb 19, 2023
@jekyll jekyll locked and limited conversation to collaborators Mar 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants