feedreader / pluto.starter

planet pluto quick starter kit - (auto-) build your own (static) planet news site from web feeds
Creative Commons Zero v1.0 Universal
12 stars 11 forks source link

Please add a section on install dependencies #2

Closed taniwallach closed 4 years ago

taniwallach commented 4 years ago

Please add a section on install dependencies needed for bundle install to work (and build pluto and the dependencies).

Debian dependencies: git ruby-bundler sqlite3 sudo gcc make libsqlite3-dev ruby-dev

(These are above a very minimal base system - see the longer post below.)

geraldb commented 4 years ago

Bundler itself is for managing (finding, resolving, listing, and installing) dependencies. If you run bundle install the first time you will get a new "Gemfile.lock" file with all dependencies (recursive all the way down) but this file depends on the platform(os) and ruby version itself. bundle install if working prints...

$ bundle install
The latest bundler is 1.16.2, but you are currently running 1.15.3.
To update, run `gem install bundler`
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Using concurrent-ruby 1.1.6
Using minitest 5.14.0
Using thread_safe 0.3.6
Using arel 9.0.0
Using logutils 0.6.1
Using bundler 1.15.3
Using iniparser 0.1.0
Using rubyzip 1.3.0
Using gli 2.19.0
Using liquid 4.0.3
Using sqlite3 1.3.13 (x86-mingw32)
Using i18n 1.8.2
Using tzinfo 1.2.6
Using activityutils 0.1.2
Using fetcher 0.4.5
Using props 1.2.0
Using activesupport 5.2.4.1
Using pakman 1.1.0
Using activemodel 5.2.4.1
Using textutils 1.4.0
Using activerecord 5.2.4.1
Using feedfilter 1.1.1
Using feedparser 2.1.2
Using activerecord-utils 0.4.1
Using logutils-activerecord 0.2.1
Using props-activerecord 0.2.0
Using pluto-models 1.5.6
Using pluto-merge 1.1.0
Using pluto-feedfetcher 0.1.4
Using pluto-update 1.6.3
Using pluto-tasks 1.5.3
Using pluto 1.3.4
Bundle complete! 4 Gemfile dependencies, 32 gems now installed.

and the Gemfile.lock reads:

GEM
  remote: https://rubygems.org/
  specs:
    activemodel (5.2.4.1)
      activesupport (= 5.2.4.1)
    activerecord (5.2.4.1)
      activemodel (= 5.2.4.1)
      activesupport (= 5.2.4.1)
      arel (>= 9.0)
    activerecord-utils (0.4.1)
      activerecord
      logutils
    activesupport (5.2.4.1)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    activityutils (0.1.2)
      logutils (>= 0.6.1)
    arel (9.0.0)
    concurrent-ruby (1.1.6)
    feedfilter (1.1.1)
      textutils (>= 1.0.1)
    feedparser (2.1.2)
      logutils (>= 0.6.1)
      textutils (>= 1.0.0)
    fetcher (0.4.5)
      logutils (>= 0.6)
    gli (2.19.0)
    i18n (1.8.2)
      concurrent-ruby (~> 1.0)
    iniparser (0.1.0)
    liquid (4.0.3)
    logutils (0.6.1)
    logutils-activerecord (0.2.1)
      activerecord
      logutils (>= 0.6.1)
    minitest (5.14.0)
    pakman (1.1.0)
      fetcher (>= 0.4.5)
      liquid (>= 4.0.0)
      logutils (>= 0.6.1)
    pluto (1.3.4)
      gli (>= 2.12.2)
      pluto-merge (>= 1.1.0)
      pluto-models (>= 1.5.4)
      pluto-tasks (>= 1.5.3)
      pluto-update (>= 1.6.3)
      sqlite3
    pluto-feedfetcher (0.1.4)
      fetcher (>= 0.4.5)
      pluto-models (>= 1.5.4)
    pluto-merge (1.1.0)
      fetcher (>= 0.4.4)
      pakman (>= 0.5.0)
      pluto-models (>= 1.2.2)
    pluto-models (1.5.6)
      activerecord
      activerecord-utils (>= 0.4.0)
      activityutils (>= 0.1.1)
      feedfilter (>= 1.1.1)
      feedparser (>= 2.1.2)
      logutils (>= 0.6.1)
      logutils-activerecord (>= 0.2.1)
      props (>= 1.2.0)
      props-activerecord (>= 0.2.0)
      textutils (>= 1.4.0)
    pluto-tasks (1.5.3)
      pluto-models (>= 1.4.0)
      pluto-update (>= 1.6.0)
    pluto-update (1.6.3)
      pluto-feedfetcher (>= 0.1.4)
      pluto-models (>= 1.5.4)
    props (1.2.0)
      iniparser (>= 0.1.0)
    props-activerecord (0.2.0)
      activerecord
      props (>= 1.2.0)
    rubyzip (1.3.0)
    sqlite3 (1.3.13-x86-mingw32)
    textutils (1.4.0)
      activesupport
      logutils (>= 0.6.1)
      props (>= 1.1.2)
      rubyzip (>= 1.0.0)
    thread_safe (0.3.6)
    tzinfo (1.2.6)
      thread_safe (~> 0.1)

PLATFORMS
  x86-mingw32

DEPENDENCIES
  activerecord (= 5.2.4.1)
  pluto
  rubyzip (= 1.3.0)
  sqlite3 (= 1.3.13)

BUNDLED WITH
   1.15.3

Is that what you're looking for? What bundle install output / errors do you get?

geraldb commented 4 years ago

A tip - I personally do NOT use bundler - all dependencies are listed in the pluto gem itself (see https://rubygems.org/gems/pluto).

As a simpler alternative for installation try:

  $ gem install pluto

and than for testing:

  $ pluto about

Does this work for you? If that's working (better) I will remove the bundle machinery from the setup / readme doc.

taniwallach commented 4 years ago

Sorry, I meant requirements below the level handled by bundle. The approach using bundle was quite quick and easy other than the need to determine dependencies to install to get the build to work. I was missing some header files needed.

I did not record the original error messages, but could recreate them by testing an install in a very minimal Docker container based on Debian I made with very few packages installed ahead of time. Details on the Docker image at the bottom.

Bottom line: The following seems to be a sufficient set of packages for Debian (above a slim base image) to allow the bundle install to succeed:


docker run --rm -it debian-ruby-bundle  bash

developer@d4e810b832fd:~$ cd pluto.starter/
developer@d4e810b832fd:~/pluto.starter$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Following files may not be writable, so sudo is needed:
  /usr/local/bin
  /var/lib/gems/2.5.0
Fetching concurrent-ruby 1.1.6
Installing concurrent-ruby 1.1.6
Fetching i18n 1.8.2
Installing i18n 1.8.2
Fetching minitest 5.14.0
Installing minitest 5.14.0
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching tzinfo 1.2.6
Installing tzinfo 1.2.6
Fetching zeitwerk 2.2.2
Installing zeitwerk 2.2.2
Fetching activesupport 6.0.2.1
Installing activesupport 6.0.2.1
Fetching activemodel 6.0.2.1
Installing activemodel 6.0.2.1
Fetching activerecord 6.0.2.1
Installing activerecord 6.0.2.1
Fetching logutils 0.6.1
Installing logutils 0.6.1
Fetching activerecord-utils 0.4.1
Installing activerecord-utils 0.4.1
Fetching activityutils 0.1.2
Installing activityutils 0.1.2
Using bundler 1.17.3
Fetching iniparser 0.1.0
Installing iniparser 0.1.0
Fetching props 1.2.0
Installing props 1.2.0
Fetching rubyzip 2.2.0
Installing rubyzip 2.2.0
Fetching textutils 1.4.0
Installing textutils 1.4.0
Fetching feedfilter 1.1.1
Installing feedfilter 1.1.1
Fetching feedparser 2.1.2
Installing feedparser 2.1.2
Fetching fetcher 0.4.5
Installing fetcher 0.4.5
Fetching gli 2.19.0
Installing gli 2.19.0
Fetching liquid 4.0.3
Installing liquid 4.0.3
Fetching logutils-activerecord 0.2.1
Installing logutils-activerecord 0.2.1
Fetching pakman 1.1.0
Installing pakman 1.1.0
Fetching props-activerecord 0.2.0
Installing props-activerecord 0.2.0
Fetching pluto-models 1.5.6
Installing pluto-models 1.5.6
Fetching pluto-merge 1.1.0
Installing pluto-merge 1.1.0
Fetching pluto-feedfetcher 0.1.4
Installing pluto-feedfetcher 0.1.4
Fetching pluto-update 1.6.3
Installing pluto-update 1.6.3
Fetching pluto-tasks 1.5.3
Installing pluto-tasks 1.5.3
Fetching sqlite3 1.4.2
Installing sqlite3 1.4.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /tmp/bundler20200213-6-tlwpxosqlite3-1.4.2/gems/sqlite3-1.4.2/ext/sqlite3
/usr/bin/ruby2.5 -r ./siteconf20200213-6-15c4e1p.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /tmp/bundler20200213-6-tlwpxosqlite3-1.4.2/gems/sqlite3-1.4.2 for inspection.
Results logged to /tmp/bundler20200213-6-tlwpxosqlite3-1.4.2/extensions/x86_64-linux/2.5.0/sqlite3-1.4.2/gem_make.out

An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  pluto was resolved to 1.3.4, which depends on
    sqlite3

Next install the libsqlite3-dev package and try again:

developer@d4e810b832fd:~/pluto.starter$ sudo apt-get install -y --no-install-recommends --no-install-suggests libsqlite3-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libc-dev-bin libc6-dev linux-libc-dev
Suggested packages:
  glibc-doc manpages-dev sqlite3-doc
Recommended packages:
  manpages manpages-dev
The following NEW packages will be installed:
  libc-dev-bin libc6-dev libsqlite3-dev linux-libc-dev
0 upgraded, 4 newly installed, 0 to remove and 9 not upgraded.
Need to get 5068 kB of archives.
After this operation, 27.3 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 libc-dev-bin amd64 2.28-10 [275 kB]
Get:2 http://deb.debian.org/debian buster/main amd64 linux-libc-dev amd64 4.19.98-1 [1314 kB]
Get:3 http://deb.debian.org/debian buster/main amd64 libc6-dev amd64 2.28-10 [2691 kB]
Get:4 http://deb.debian.org/debian buster/main amd64 libsqlite3-dev amd64 3.27.2-3 [787 kB]
Fetched 5068 kB in 1s (5156 kB/s)       
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libc-dev-bin.
(Reading database ... 12403 files and directories currently installed.)
Preparing to unpack .../libc-dev-bin_2.28-10_amd64.deb ...
Unpacking libc-dev-bin (2.28-10) ...
Selecting previously unselected package linux-libc-dev:amd64.
Preparing to unpack .../linux-libc-dev_4.19.98-1_amd64.deb ...
Unpacking linux-libc-dev:amd64 (4.19.98-1) ...
Selecting previously unselected package libc6-dev:amd64.
Preparing to unpack .../libc6-dev_2.28-10_amd64.deb ...
Unpacking libc6-dev:amd64 (2.28-10) ...
Selecting previously unselected package libsqlite3-dev:amd64.
Preparing to unpack .../libsqlite3-dev_3.27.2-3_amd64.deb ...
Unpacking libsqlite3-dev:amd64 (3.27.2-3) ...
Setting up linux-libc-dev:amd64 (4.19.98-1) ...
Setting up libc-dev-bin (2.28-10) ...
Setting up libc6-dev:amd64 (2.28-10) ...
Setting up libsqlite3-dev:amd64 (3.27.2-3) ...
developer@d4e810b832fd:~/pluto.starter$  
developer@d4e810b832fd:~/pluto.starter$ 
developer@d4e810b832fd:~/pluto.starter$ 
developer@d4e810b832fd:~/pluto.starter$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using concurrent-ruby 1.1.6
Following files may not be writable, so sudo is needed:
  /usr/local/bin
  /var/lib/gems/2.5.0
  /var/lib/gems/2.5.0/build_info
  /var/lib/gems/2.5.0/cache
  /var/lib/gems/2.5.0/doc
  /var/lib/gems/2.5.0/extensions
  /var/lib/gems/2.5.0/gems
  /var/lib/gems/2.5.0/specifications
Using i18n 1.8.2
Using minitest 5.14.0
Using thread_safe 0.3.6
Using tzinfo 1.2.6
Using zeitwerk 2.2.2
Using activesupport 6.0.2.1
Using activemodel 6.0.2.1
Using activerecord 6.0.2.1
Using logutils 0.6.1
Using activerecord-utils 0.4.1
Using activityutils 0.1.2
Using bundler 1.17.3
Using iniparser 0.1.0
Using props 1.2.0
Using rubyzip 2.2.0
Using textutils 1.4.0
Using feedfilter 1.1.1
Using feedparser 2.1.2
Using fetcher 0.4.5
Using gli 2.19.0
Using liquid 4.0.3
Using logutils-activerecord 0.2.1
Using pakman 1.1.0
Using props-activerecord 0.2.0
Using pluto-models 1.5.6
Using pluto-merge 1.1.0
Using pluto-feedfetcher 0.1.4
Using pluto-update 1.6.3
Using pluto-tasks 1.5.3
Fetching sqlite3 1.4.2
Installing sqlite3 1.4.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /tmp/bundler20200213-527-16x4gbpsqlite3-1.4.2/gems/sqlite3-1.4.2/ext/sqlite3
/usr/bin/ruby2.5 -r ./siteconf20200213-527-n2bnz2.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /tmp/bundler20200213-527-16x4gbpsqlite3-1.4.2/gems/sqlite3-1.4.2 for inspection.
Results logged to /tmp/bundler20200213-527-16x4gbpsqlite3-1.4.2/extensions/x86_64-linux/2.5.0/sqlite3-1.4.2/gem_make.out

An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  pluto was resolved to 1.3.4, which depends on
    sqlite3

Next install the ruby-dev package and try again:

developer@d4e810b832fd:~/pluto.starter$ sudo apt-get install -y --no-install-recommends --no-install-suggests ruby-dev      
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libgmp-dev libgmpxx4ldbl ruby2.5-dev
Suggested packages:
  gmp-doc libgmp10-doc libmpfr-dev
Recommended packages:
  ruby2.5-doc
The following NEW packages will be installed:
  libgmp-dev libgmpxx4ldbl ruby-dev ruby2.5-dev
0 upgraded, 4 newly installed, 0 to remove and 9 not upgraded.
Need to get 1076 kB of archives.
After this operation, 2665 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 libgmpxx4ldbl amd64 2:6.1.2+dfsg-4 [22.9 kB]
Get:2 http://deb.debian.org/debian buster/main amd64 libgmp-dev amd64 2:6.1.2+dfsg-4 [628 kB]
Get:3 http://deb.debian.org/debian buster/main amd64 ruby2.5-dev amd64 2.5.5-3+deb10u1 [415 kB]
Get:4 http://deb.debian.org/debian buster/main amd64 ruby-dev amd64 1:2.5.1 [10.2 kB]
Fetched 1076 kB in 1s (1121 kB/s)  
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libgmpxx4ldbl:amd64.
(Reading database ... 13877 files and directories currently installed.)
Preparing to unpack .../libgmpxx4ldbl_2%3a6.1.2+dfsg-4_amd64.deb ...
Unpacking libgmpxx4ldbl:amd64 (2:6.1.2+dfsg-4) ...
Selecting previously unselected package libgmp-dev:amd64.
Preparing to unpack .../libgmp-dev_2%3a6.1.2+dfsg-4_amd64.deb ...
Unpacking libgmp-dev:amd64 (2:6.1.2+dfsg-4) ...
Selecting previously unselected package ruby2.5-dev:amd64.
Preparing to unpack .../ruby2.5-dev_2.5.5-3+deb10u1_amd64.deb ...
Unpacking ruby2.5-dev:amd64 (2.5.5-3+deb10u1) ...
Selecting previously unselected package ruby-dev:amd64.
Preparing to unpack .../ruby-dev_1%3a2.5.1_amd64.deb ...
Unpacking ruby-dev:amd64 (1:2.5.1) ...
Setting up libgmpxx4ldbl:amd64 (2:6.1.2+dfsg-4) ...
Setting up libgmp-dev:amd64 (2:6.1.2+dfsg-4) ...
Setting up ruby2.5-dev:amd64 (2.5.5-3+deb10u1) ...
Setting up ruby-dev:amd64 (1:2.5.1) ...
Processing triggers for libc-bin (2.28-10) ...
developer@d4e810b832fd:~/pluto.starter$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using concurrent-ruby 1.1.6
Following files may not be writable, so sudo is needed:
  /usr/local/bin
  /var/lib/gems/2.5.0
  /var/lib/gems/2.5.0/build_info
  /var/lib/gems/2.5.0/cache
  /var/lib/gems/2.5.0/doc
  /var/lib/gems/2.5.0/extensions
  /var/lib/gems/2.5.0/gems
  /var/lib/gems/2.5.0/specifications
Using i18n 1.8.2
Using minitest 5.14.0
Using thread_safe 0.3.6
Using tzinfo 1.2.6
Using zeitwerk 2.2.2
Using activesupport 6.0.2.1
Using activemodel 6.0.2.1
Using activerecord 6.0.2.1
Using logutils 0.6.1
Using activerecord-utils 0.4.1
Using activityutils 0.1.2
Using bundler 1.17.3
Using iniparser 0.1.0
Using props 1.2.0
Using rubyzip 2.2.0
Using textutils 1.4.0
Using feedfilter 1.1.1
Using feedparser 2.1.2
Using fetcher 0.4.5
Using gli 2.19.0
Using liquid 4.0.3
Using logutils-activerecord 0.2.1
Using pakman 1.1.0
Using props-activerecord 0.2.0
Using pluto-models 1.5.6
Using pluto-merge 1.1.0
Using pluto-feedfetcher 0.1.4
Using pluto-update 1.6.3
Using pluto-tasks 1.5.3
Fetching sqlite3 1.4.2
Installing sqlite3 1.4.2 with native extensions
Fetching pluto 1.3.4
Installing pluto 1.3.4
Bundle complete! 2 Gemfile dependencies, 32 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

Success so run a test:

developer@d4e810b832fd:~/pluto.starter$ bundle exec pluto help
NAME
    pluto - another planet generator (lets you build web pages from published web feeds)

SYNOPSIS
    pluto [global options] command [command options] [arguments...]

VERSION
    1.3.4

GLOBAL OPTIONS
    -c, --config=PATH         - Configuration Path (default: /home/developer/.pluto)
    --help                    - Show this message
    -q, --quiet, -w, --warn   - Only show warnings, errors and fatal messages
    --quieter, --err, --error - Only show errors and fatal messages
    --verbose, --debug        - (Debug) Show debug messages
    --version                 - Display the program version

COMMANDS
    about, a      - (Debug) Show more version info
    build, b      - Build planet
    fetch, f      - Fetch feeds
    help          - Shows a list of commands or help for one command
    install, i    - Install template pack
    list, ls, l   - List installed template packs
    merge, m      - Merge planet template pack
    test          - (Debug) Show global options, options, arguments for test command
    update, up, u - Update planet feeds

The minimal Docker image was created using

Dockerfile:

FROM debian:buster-slim

RUN apt-get update \
    && apt-get install -y --no-install-recommends --no-install-suggests \
    git ruby-bundler sqlite3 sudo gcc make

RUN export uid=1000 gid=1000 && \
    mkdir -p /home/developer && \
    echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
    /usr/bin/passwd -d developer && \
    echo "developer:x:${uid}:" >> /etc/group && \
    echo "developer ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers  && \
    chown -R developer:1000 /home/developer/

USER developer
ENV HOME /home/developer

WORKDIR /home/developer

RUN git clone https://github.com/feedreader/pluto.starter.git ; chown -R developer pluto.starter

CMD ["/bin/bash"]

docker-compose.yml:

version: '3.5'
services:
  app:
    image: debian-ruby-bundle
    build: .

and then running docker-compose build

geraldb commented 4 years ago

I see. Wow thanks for all the detailed examples. I will try to work it all into the readme / docs in the next days.

geraldb commented 4 years ago

Hello, if you scroll down on the readme to the Q&A there's now a new entry "Q: What packages for Debian (above a slim base image) allow the bundle install to succeed?". I added all info as far as I understand (along with credit). Thanks. Cheers.