Warbler with Bundler and Jruby seems to be broken

412 views Asked by At

When warbler creates the war file and I deploy it into tomcat I get a GemNotFound error. We use a CI docker node in GitLab to create our deployed war files. I will include that below as well, I have been hacking at it so it is a mess. I have tried every combination of suggestions but havent found anything. The error I am getting when the war is deployed: GemNotFound unable to load thrift libraries

Gemfile

# Local Gem Repository used in production
source 'http://nexus3/repository/rubygems/'

gem 'rails'

gem 'activerecord-jdbcsqlite3-adapter'

# Use SASS for stylesheets
gem 'sassc-rails'

# Use Twitter Bootstrap
gem 'bootstrap-sass'

# Icon font
gem 'font-awesome-rails'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyrhino'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# To use debugger
#gem 'ruby-debug-ide'
#gem 'ruby-debug-base'
#gem 'ruby-debug19', :require => 'ruby-debug'

gem 'responders'


group :development, :test do
  gem 'warbler', :require => false
  gem 'jruby-jars'

  gem 'database_cleaner'
  gem 'jruby-lint', :require => false

  #jasmine tests
  gem 'jasmine'
  #gem 'guard'
  #gem 'guard-jasmine'


  #test
  gem 'selenium-webdriver'
  gem 'apparition', git: 'https://github.com/twalpole/apparition.git'
  gem 'capybara-screenshot'
  gem 'jruby-rack'
  gem 'rspec'
  gem 'rspec-rails'
  gem 'cucumber-rails', :require => false
  gem 'webrat'
  gem 'factory_bot_rails', :require => false
  gem 'foreman'

  #code quality
  gem 'metric_fu'

  gem 'simplecov', :require => false, :group => :test
  #gem 'pry-byebug'
  #gem 'pry-nav'
end

gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'knockoutjs-rails'
gem 'modernizr-rails'
gem 'underscore-rails'
gem 'respond-js-rails'
gem 'sammyjs-rails', git: 'https://github.com/szechyjs/sammyjs-rails.git'
gem 'momentjs-rails'
gem 'bootstrap-growl-rails'
gem 'animate-rails'

gem 'browserify-rails'

gem 'rest-client'
gem 'rubyzip'

gem 'semver2'

# Attachment Uploader
gem 'carrierwave'
gem 'mini_magick'

# XML Parser with XPATH support
gem 'nokogiri'

# Rails server is slow, use puma
gem 'puma'

gem 'tinymce-rails'

# Use thrift for services
gem 'thrift', '0.11.0'
gem 'thrift_client', '0.11.0'

gem 'html5shiv-rails'
#gem 'rake-minify' #this is used for the tinymce plugins we have - see the minification.rb initializer

.gitlab-ci.yml

image: docker.corp.xxxxxxxxxxxxxx

variables:
  JRUBY_OPTS: "--debug -J-Xmx2G"
  CI_COMMON: /share/clones/ci-common/develop
  #BUNDLE_PATH: ""

before_script:
  - git submodule init
  - git submodule update
  - cd server
  - unset BUNDLE_PATH
  - unset GEM_HOME
  - unset GEM_PATH
  - export BUNDLE_APP_CONFIG=vendor/bundle
  #- export GEM_PATH=vendor/bundle
  #- gem install bundler -v 2.1.4
  #- bin/bundle config deployment true
 # - bin/bundle config path vendor/bundle
#  - bundle config disable_shared_gems true
#  - bundle binstubs
  - bin/bundle install -j$(nproc) --binstubs --deployment
  - npm install --quiet
#  - bundle check
  - bin/bundle exec gem env
  - bin/bundle config

#cache:
#  paths:
#    - server/.bundle/
#    - server/vendor/bundle/
#    - server/node_modules/
#    - server/bin/

stages:
#  - test
  - build
  - omnibus-build
  - omnibus-install

#rspec:
#  stage: test
#  tags:
#    - docker
#  except:
#    - tags
#  script:
#    - bin/rake db:migrate RAILS_ENV=test
#    - bin/rspec

#cucumber:
#  stage: test
#  tags:
#    - docker
#  except:
#    - tags
#  script:
#    - bin/rake db:migrate RAILS_ENV=test
#    - bin/cucumber

#changelog-check:
#  except:
#    - develop
#    - /^release.*$/
#  stage: test
#  allow_failure: true
 # tags:
 #   - docker
 # script:
 #   - $CI_COMMON/changelog-check $CI_COMMIT_REF_NAME

war:
  stage: build
  only:
    - develop
    - /^release.*$/
    - production-fix
  tags:
    - docker
  except:
    - tags
  script:
#    - rake war:debug
    - bin/rake build:war
    - mkdir -p /share/artifacts/${CI_PROJECT_NAME}
    - rm -f /share/artifacts/${CI_PROJECT_NAME}/${CI_PROJECT_NAME}-$CI_COMMIT_REF_NAME.tar.gz
    - tar -zcf /share/artifacts/${CI_PROJECT_NAME}/${CI_PROJECT_NAME}-$CI_COMMIT_REF_NAME.tar.gz ROOT.war

...

Output of the command bin/bundle config and the output of bin/bundle exec gem env from within my yml file:

bin/bundle exec gem env
 RubyGems Environment:
   - RUBYGEMS VERSION: 3.0.6
   - RUBY VERSION: 2.5.7 (2020-03-25 patchlevel 0) [java]
   - INSTALLATION DIRECTORY: /builds/mrts/WebRET/server/vendor/bundle/jruby/2.5.0
   - USER INSTALLATION DIRECTORY: /root/.gem/jruby/2.5.0
   - RUBY EXECUTABLE: /opt/jruby/bin/jruby
   - GIT EXECUTABLE: /usr/bin/git
   - EXECUTABLE DIRECTORY: /builds/mrts/WebRET/server/vendor/bundle/jruby/2.5.0/bin
   - SPEC CACHE DIRECTORY: /root/.gem/specs
   - SYSTEM CONFIGURATION DIRECTORY: /opt/jruby/etc
   - RUBYGEMS PLATFORMS:
     - ruby
     - universal-java-1.8
   - GEM PATHS:
      - /builds/mrts/WebRET/server/vendor/bundle/jruby/2.5.0
   - GEM CONFIGURATION:
      - :update_sources => true
      - :verbose => true
      - :backtrace => false
      - :bulk_threshold => 1000
      - "install" => "--no-document"
      - "update" => "--no-document"
   - REMOTE SOURCES:
      - https://rubygems.org/
   - SHELL PATH:
      - /builds/mrts/WebRET/server/vendor/bundle/jruby/2.5.0/bin
      - /usr/local/bundle/bin
      - /opt/jruby/bin
      - /usr/local/openjdk-8/bin
      - /usr/local/sbin
      - /usr/local/bin
      - /usr/sbin
      - /usr/bin
      - /sbin
      - /bin
 $ bin/bundle config
 Settings are listed in order of priority. The top value will be used.
 deployment
 Set for your local app (/builds/mrts/WebRET/server/vendor/bundle/config): true
 path
 Set for your local app (/builds/mrts/WebRET/server/vendor/bundle/config): "vendor/bundle"
 bin
 Set for your local app (/builds/mrts/WebRET/server/vendor/bundle/config): "bin"
 Set via BUNDLE_BIN: "/usr/local/bundle/bin"
 jobs
 Set for your local app (/builds/mrts/WebRET/server/vendor/bundle/config): 48
 app_config
 Set via BUNDLE_APP_CONFIG: "vendor/bundle"
 silence_root_warning
 Set via BUNDLE_SILENCE_ROOT_WARNING: true
 gemfile
 Set via BUNDLE_GEMFILE: "/builds/mrts/WebRET/server/Gemfile"

Dockerfile used to create docker container:

FROM jruby:9.2.11.1-jdk

RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*

# install chrome
ENV CHROME_VERSION "google-chrome-stable"
RUN sed -i -- 's&deb http://deb.debian.org/debian jessie-updates main&#deb http://deb.debian.org/debian jessie-updates main&g' /etc/apt/sources.list \
  && apt-get update && apt-get install wget -y
ENV CHROME_VERSION "google-chrome-stable"
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
  && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list \
  && apt-get update && apt-get -qqy install ${CHROME_VERSION:-google-chrome-stable}

# gpg keys listed at https://github.com/nodejs/node
RUN set -ex \
  && for key in \
    9554F04D7259F04124DE6B476D5A82AC7E37093B \
    94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
    0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 \
    FD3A5288F042B6850C66B31F09FE44734EB7990E \
    71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
    DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
  ; do \
    gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
  done

ENV NPM_CONFIG_LOGLEVEL info
#ENV NODE_VERSION 4.2.1
ENV NODE_VERSION 10.15.2

RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \
  && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
  && gpg --verify SHASUMS256.txt.asc \
  && grep " node-v$NODE_VERSION-linux-x64.tar.gz\$" SHASUMS256.txt.asc | sha256sum -c - \
  && tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 \
  && rm "node-v$NODE_VERSION-linux-x64.tar.gz" SHASUMS256.txt.asc

ADD id_rsa /root/.ssh/
RUN /bin/echo -e "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null\n\n" > /root/.ssh/config

RUN chmod 700 /root/.ssh && chmod 600 /root/.ssh/id_rsa
0

There are 0 answers