2

I'm running bundle install --no-cache --path ./vendor/bundle on this gemfile in a Jenkins build. I'm then using widdershins to convert my OpenAPI spec documentation to a slate-compatible format. The issue I'm running into is that widdershins can't find the middleman-cli gem.

...
Compiling main.dot to function
Compiling operation.dot to function
Compiling translations.dot to function
/usr/lib/ruby/2.3.0/rubygems.rb:241:in `bin_path': can't find gem middleman-cli (>= 0.a) (Gem::GemNotFoundException)

from ./vendor/bundle/ruby/2.3.0/bin/middleman:22:in `<main>

So I'm attempting to verify that gem is installed via the below 2 commands and am not seeing middleman installed at all. This makes me wonder why it's not installing the needed dependencies...

ruby -S gem list --local ruby -e 'puts Gem::Specification.all_names'

Both commands show the same output which is here:

bigdecimal (1.2.8)
bundler (1.15.1)
did_you_mean (1.0.0)
io-console (0.4.5)
json (1.8.3)
minitest (5.10.3)
molinillo (0.5.0)
net-http-persistent (2.9.4)
net-telnet (0.1.1)
power_assert (0.2.7)
psych (2.1.0)
rake (12.0.0)
rdoc (4.2.1)
test-unit (3.2.5)
thor (0.19.4)

To give some context on the scope where these commands are run, here's a snippet from my Jenkinsfile:

// generate API documentation
sh 'git clone https://github.com/lord/slate.git'
dir('slate'){
    sh 'ls -ao'
    sh 'cat Gemfile.lock | grep middleman'
    sh 'bundle install --no-cache --path ./vendor/bundle'
    sh "ruby -S gem list --local"
    sh "ruby -e 'puts Gem::Specification.all_names'"
}
Ben
  • 60,438
  • 111
  • 314
  • 488
  • Can you add your Gemfile please? That doesn't look like a ruby error... – Mark May 25 '18 at 14:14
  • Also have you tried gem install middleman ? – Mark May 25 '18 at 14:18
  • @Mark I've resolved the nodejs issue and updated my question to reflect the only outstanding error. My original question links to this gemfile: https://github.com/lord/slate/blob/2245e95e485f9a2e583890a118aadc1bab964eac/Gemfile.lock#L45. Shouldn't `bundle install` be installing middleman though? – Ben May 25 '18 at 14:52
  • 1
    You're right it should - I'm curious what entering 'gem install middleman-cli' returns? – Mark May 25 '18 at 14:55
  • Or if you run 'bundle show middleman-cli' it should give you the path if you've installed it – Mark May 25 '18 at 14:56
  • @Mark `+ bundle show middleman-cli "/" is not writable. Bundler will use `/tmp/bundler/home/unknown' as your home directory temporarily. /home/ubuntu/workspace/path-to-project/slate/vendor/bundle/ruby/2.3.0/gems/middleman-cli-4.2.1` – Ben May 25 '18 at 16:39

0 Answers0