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

使用docker运行出现以下错误 #17

Open
GaoHaHa-IronMan opened this issue Nov 16, 2024 · 1 comment
Open

使用docker运行出现以下错误 #17

GaoHaHa-IronMan opened this issue Nov 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@GaoHaHa-IronMan
Copy link

系统版本:macOS13
系统架构:arm64
克隆项目后修改Dockerfile为以下内容:

FROM ruby:2.7.5
ENV WORKDIR=/usr/src/app
workdir $WORKDIR
RUN apt-get update && apt-get install -y cron && apt-get install -y vim
COPY Gemfile Gemfile.lock ./
RUN bundle install
CMD ["tail", "-f", "/dev/null"]

然后在容器内运行 bundle exec bin/ZMediumToMarkdown -p https://medium.com/javarevisited/stop-using-if-else-statements-in-java-57234e13bf9d出现错误,错误如下:

root@16710832f503:/usr/src/app# bundle exec bin/ZMediumToMarkdown -p https://medium.com/javarevisited/stop-using-if-else-statements-in-java-57234e13bf9d
#https://github.com/ZhgChgLi/ZMediumToMarkdown
You have read and agree with the Disclaimer.
[stop-using-if-el...]-Downloading Post...
#Error: NoMethodError undefined method `dig' for "":String
/usr/src/app/lib/Post.rb:77:in `parsePostInfoFromPostContent'
/usr/src/app/lib/ZMediumFetcher.rb:150:in `downloadPost'
bin/ZMediumToMarkdown:99:in `initialize'
bin/ZMediumToMarkdown:117:in `new'
bin/ZMediumToMarkdown:117:in `<top (required)>'
/usr/local/lib/ruby/2.7.0/bundler/cli/exec.rb:63:in `load'
/usr/local/lib/ruby/2.7.0/bundler/cli/exec.rb:63:in `kernel_load'
/usr/local/lib/ruby/2.7.0/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/2.7.0/bundler/cli.rb:476:in `exec'
/usr/local/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/usr/local/lib/ruby/2.7.0/bundler/cli.rb:30:in `dispatch'
/usr/local/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/usr/local/lib/ruby/2.7.0/bundler/cli.rb:24:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/libexec/bundle:46:in `block in <top (required)>'
/usr/local/lib/ruby/2.7.0/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/libexec/bundle:34:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
#Please feel free to open an Issue or submit a fix/contribution via Pull Request on:
#https://github.com/ZhgChgLi/ZMediumToMarkdown
@zhgchgli0718 zhgchgli0718 added the bug Something isn't working label Nov 17, 2024
@zhgchgli0718 zhgchgli0718 self-assigned this Nov 17, 2024
@zhgchgli0718
Copy link
Member

It’s weird because I tried the same command outside of Docker, and it works fine. Could you try again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants