pact-foundation / pact-mock_service

Provides a mock service for use with Pact
https://pact.io
MIT License
74 stars 69 forks source link

stand-alone Pact Mock Service 0.5.1 not starting / installation instructions incorrect #27

Closed timoreimann closed 9 years ago

timoreimann commented 9 years ago

I tried to run the latest Pact Mock Service (version 0.5.1) on my Mac as instructed on the release page, namely:

curl -LO https://github.com/bethesque/pact-mock_service/releases/download/v0.5.1/pact-mock-service-0.5.1-1-osx.tar.gz
tar xzf pact-mock-service-0.5.1-1-osx.tar.gz
cd pact-mock-service-0.5.1-1-osx
./pact-mock-service -p 1234

First of all, there's no pact-mock-service file in the root of the unpacked directory. There's a bin directory though, but when I try to start that one I get:

$ ./pact-mock-service -p 1234
Could not find awesome_print-1.6.1 in any of the sources
Run `bundle install` to install missing gems.

Here's the detailed output running with bash -x:

$ bash -x ./pact-mock-service 
+ set -e
++ dirname ./pact-mock-service
+ SELFDIR=.
++ cd .
++ cd ..
++ pwd
+ SELFDIR=/Users/treimann/Tasks/pact_mock_service/bin/pact-mock-service-0.5.1-1-osx
+ export BUNDLE_GEMFILE=/Users/treimann/Tasks/pact_mock_service/bin/pact-mock-service-0.5.1-1-osx/lib/vendor/Gemfile
+ BUNDLE_GEMFILE=/Users/treimann/Tasks/pact_mock_service/bin/pact-mock-service-0.5.1-1-osx/lib/vendor/Gemfile
+ unset BUNDLE_IGNORE_CONFIG
+ exec /Users/treimann/Tasks/pact_mock_service/bin/pact-mock-service-0.5.1-1-osx/lib/ruby/bin/ruby -rbundler/setup -I/Users/treimann/Tasks/pact_mock_service/bin/pact-mock-service-0.5.1-1-osx/lib/app/lib /Users/treimann/Tasks/pact_mock_service/bin/pact-mock-service-0.5.1-1-osx/lib/app/pact-mock-service.rb
Could not find awesome_print-1.6.1 in any of the sources
Run `bundle install` to install missing gems.

I realize that I am missing a dependency. However, my understanding of the stand-alone server was that I do not need to install Ruby or any Ruby dependencies. Am I missing something?

FWIW, when I execute the start command directly from the root directory without the bash wrapper, I get a bit further:

$ ls -1d *
bin
lib
$ ( export BUNDLE_GEMFILE=$(pwd)/lib/vendor/Gemfile && unset BUNDLE_IGNORE_CONFIG && lib/ruby/bin/ruby -rbundler/setup -I$(pwd)/lib/app/lib -I$(pwd)/lib/app/pact-mock-service.rb -p 1234 )
/Users/treimann/Tasks/pact_mock_service/bin/pact-mock-service-0.5.1-1-osx/lib/ruby/bin.real/ruby: No such file or directory -- 1234 (LoadError)

The error is a bit weird to me because the file does exist:

$ test -f /Users/treimann/Tasks/pact_mock_service/bin/pact-mock-service-0.5.1-1-osx/lib/ruby/bin.real/ruby && echo "ruby binary exists"
ruby binary exists

Side note: Version 0.5.1 seems to be fairly behind the latest code version (0.7.1). Would be great to see an update in this regards as well.

bethesque commented 9 years ago

I've uploaded 0.7.1, please try again with the latest version https://github.com/bethesque/pact-mock_service/releases/tag/0.7.1

timoreimann commented 9 years ago

This one's working. Thanks!