Can't install gosu gem - ruby

I am trying to install gosu gem using docker but I am getting the following error:
/usr/local/bundle/gems/gosu-1.4.5/lib/gosu.so: warning: undefining the allocator of T_DATA class swig_runtime_data
/usr/local/bundle/gems/gosu-1.4.5/lib/gosu/swig_patches.rb:18:in `initialize': Could not initialize SDL Video: No available video device (RuntimeError)
I have tried modifying the dockerfile or installing additional libraries
For example:
ENV XDG_RUNTIME_DIR=/tmp
or
apt install xorg-dev
Here is my Dockerfile
from ruby:latest
WORKDIR /usr/src/app
COPY . .
RUN apt-get update && apt-get -qq -y install curl && apt-get install -y build-essential libsdl2-dev libgl1-mesa-dev libopenal-dev libgmp-dev libfontconfig1-dev xorg-dev && gem install gosu
ENV XDG_RUNTIME_DIR=/tmp
EXPOSE 3000

It depends on the SDL library to display graphics. Add this to docker file,
RUN apt-get update && apt-get install -y libsdl2-dev
RUN gem install gosu
Refer this for the set of libraries to be further added for docker if the above command don't solve the issue. unable to install Gosu library in Ruby in Linux .

Related

How can I install ruby 2.7.2 (Dockerfile) in Ubuntu 18.04?

I am creating a Dockerfile and somehow I can't install the ruby version I need: 2.7.2 . Since I just need this version, I don't want to install ruby through rbenv or rvm. I tried "apt install ruby", "apt get install ruby 2.7.2", "apt install ruby-full" and the version installed is always 2.5.1. Any Ideas?
This is how my Dockerfile looks like:
FROM nvidia/cuda:10.1-base-ubuntu18.04
LABEL version="0.0.1"
LABEL maintainer="mjg"
RUN apt update \
&& apt install -y python3.6 python3-pip \
&& apt install -y ruby
WORKDIR /cvlib
RUN pip3 install --upgrade pip; \
pip3 install opencv-python tensorflow cvlib; \
apt install -y libsm6 libxext6 libxrender-dev libgl1-mesa-glx; \
apt remove -y python3-pip
WORKDIR /app
COPY . .
VOLUME [ "/app/blurred-images", "app/source-images" ]
Using apt install ruby will install ruby version from distribution repository, which in your case in ruby 2.5.1. You should consider installing it with ruby version managers like rbenv or rvm, because they allow you to specify specific version that you want to install.

How can I get SASS/Compass into the DDEV web container?

A client needs Compass for SASS compilation inside the DDEV-Local web container. How can I get compass in there?
Compass requires ruby and rubygems, and rubygems requires a full build environment to build compass. (See http://compass-style.org/install/)
You can get all that with a .ddev/web-build/Dockerfile like this:
ARG BASE_IMAGE
FROM $BASE_IMAGE
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confold" --no-install-recommends --no-install-suggests build-essential ruby-full rubygems
RUN gem install compass
A slightly smaller approach would be to just add webimage_extra_packages: [ ruby-full, rubygems, build-essential ] to your .ddev/config.yaml and then use ddev exec sudo gem install compass when you need compass.

sqlalchemy connection issue while running docker image on local window machine

docker image builds successfully. But when actually I run docker image using docker run command to check if my application works fine. I got the below issue.
Please need guidance over this issue. Thanks a lot
issue:
sqlalchemy.exc.DBAPIError: (pyodbc.Error) ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)")
(Background on this error at: http://sqlalche.me/e/dbapi)
connection string:
def connectiondb():
params = urllib.parse.quote_plus(
"DRIVER={SQL Server};SERVER=servername;DATABASE=dbname;UID=username;PWD=password")
engine = sqlalchemy.create_engine("mssql+pyodbc:///?odbc_connect=%s" % params)
metadata = MetaData(engine)
con = engine.connect()
dockerfile:
FROM python:latest
Bundle app source
COPY . /app
WORKDIR /app
Update
RUN pip install --upgrade pip
RUN apt-get update &&
apt-get install -y apt-transport-https &&
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - &&
curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list &&
apt-get update &&
ACCEPT_EULA=Y apt-get install msodbcsql17 unixodbc-dev -y
RUN apt-get install libssl-dev
RUN pip install pyodbc==4.0.28
RUN pip install numpy==1.18.1
RUN pip install scikit-multiflow==0.4.1
RUN pip install Cython
RUN pip install scikit-learn==0.21.3
RUN pip install -r requirements.txt
EXPOSE 5000
CMD python ./app.py
return con, metadata,engine

Google Cloud Build and GLIBCXX_3.4.21 not found(for TexturePacker)

I'm trying to use Google Cloud Build to build my project which requires TexturePacker.
I managed to install TexturePacker but once script execute its CLI I get this error:
/usr/bin/../lib/texturepacker/TexturePacker_: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/bin/../lib/texturepacker/TexturePacker_)
Tried to install necessary lib but still no success (like below):
FROM gcr.io/cloud-builders/yarn
RUN apt-get update && apt-get install -y libgl1-mesa-glx
RUN apt-get install -y libstdc++6
RUN wget https://www.codeandweb.com/download/texturepacker/5.2.0/TexturePacker-5.2.0-ubuntu64.deb && dpkg -i TexturePacker-5.2.0-ubuntu64.deb
Does anyone has an idea on how to fix it?
I was managed to solve it using this Dockerfile:
FROM node:latest
RUN apt-get update
# Install updates and dependencies
RUN apt-get install --no-install-recommends -y -q curl python build-essential git ca-certificates libkrb5-dev imagemagick && \
apt-get clean && rm /var/lib/apt/lists/*_*
#TexturePacker and dependencies
RUN apt-get install -y libgl1-mesa-glx
RUN apt-get install -y libstdc++6
RUN wget https://www.codeandweb.com/download/texturepacker/5.2.0/TexturePacker-5.2.0-ubuntu64.deb && dpkg -i TexturePacker-5.2.0-ubuntu64.deb

configure: error: cannot find libz

Building Mesos 1.3.0 from sources on linux-mint release 18.2 I get the following message:
configure: error: cannot find libz
When I try to search packages starts with libz* I get many packages names starting with libz. Which one is the right package I should install it?
Try installing zlib1g-dev. It's listed in the documentation
Linux Mint 18.2 is based on Ubuntu 16.04.
So, you should follow instructions for Ubuntu
16.04.
# Update the packages.
$ sudo apt-get update
# Install a few utility tools.
$ sudo apt-get install -y tar wget git
# Install the latest OpenJDK.
$ sudo apt-get install -y openjdk-8-jdk
# Install autotools (Only necessary if building from git repository).
$ sudo apt-get install -y autoconf libtool
# Install other Mesos dependencies.
$ sudo apt-get -y install build-essential python-dev python-six python-virtualenv libcurl4-nss-dev libsasl2-dev libsasl2-modules maven libapr1-dev libsvn-dev zlib1g-dev

Resources