chauduyphanvu / reddit-markdown

MIT License
38 stars 6 forks source link

fails with '`require': cannot load such file -- kramdown' #16

Closed emilBeBri closed 1 year ago

emilBeBri commented 1 year ago

Hey, looks like a cool little script, I don't know ruby so forgive me if I have overlooked something. When running the script either with a cli argument or without like this:

ruby reddit-markdown.rb

it fails with this message:


 ruby reddit_markdown.rb
<internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- kramdown (LoadError)
    from <internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from reddit_markdown.rb:5:in `<main>'

I'm on manjaro linux fully updated, ruby version installed:


ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c5) [x86_64-linux]
chauduyphanvu commented 1 year ago

Thanks for letting me know. This seems to be an oversight on my end. Please run the following command to manually install kramdown, which is a dependency for my Ruby script:

sudo gem install kramdown

I'll include this dependency in a gemfile in a future version. Meanwhile, let me know if running the above command manually resolves the issue. Thanks.

emilBeBri commented 1 year ago

THis works, thank you. I did it without sudo though, and put

~/.local/share/gem/ruby/3.0.0/bin

in my $PATH. works great. nice cli app here. There are some subreddits where I get

HTTP Error: 403 Forbidden

But I guess that's something that the moderators of that sub have put on and there is no way around that.

chauduyphanvu commented 1 year ago

Thanks for confirming.

Regarding the 403, it might be possible once the script supports authentication (next release). I'll check that though provided I can get into a private sub.

chauduyphanvu commented 1 year ago

As of the latest version, 403 is now handled gracefully (i.e. skipped) instead of erroring out.

Also, I've added a Gemfile where future gems (if any) will be documented for easy installation via bundle install