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

Sinatra version issue #79

Open
yeoleobun opened this issue Oct 10, 2022 · 1 comment
Open

Sinatra version issue #79

yeoleobun opened this issue Oct 10, 2022 · 1 comment

Comments

@yeoleobun
Copy link

yeoleobun commented Oct 10, 2022

The code at https://github.com/turnbullpress/dockerbook-code/blob/master/code/5/sinatra/webapp/Dockerfile#L6
and https://github.com/turnbullpress/dockerbook-code/blob/master/code/5/sinatra/webapp_redis/Dockerfile#L6 can't progress.

#6 1.939 ERROR:  Error installing sinatra:                                      
#6 1.939        There are no versions of mustermann (~> 3.0) compatible with your Ruby & RubyGems. Maybe try installing an older version of the gem you're looking for?                                                                         
#6 1.939 	mustermann requires Ruby version >= 2.6.0. The current ruby version is 2.5.0.

According https://github.com/sinatra/sinatra/blob/master/README.md?plain=1#L2828

Versions of Ruby before 2.6 are no longer supported as of Sinatra 3.0.0.

But the version of ruby on apt is 2.5.0, and sinatra version on gem is 3.0.2, so it's a conflict.

It's better to give a specific version to sinatra. (2.2.2 was latest supporting Ruby 2.5)

@Break00
Copy link

Break00 commented Jun 27, 2023

it works!!!

FROM ubuntu:18.04
  
RUN apt-get -qq update && apt-get -qq install ruby ruby-dev build-essential redis-tools
RUN gem install --no-rdoc --no-ri json redis
RUN gem install --no-rdoc --no-ri sinatra -v 2.2.2

RUN mkdir -p /opt/webapp

EXPOSE 4567

CMD [ "sh", "-c", "ruby /opt/webapp/bin/webapp" ]

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