Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running script/test fails #127

Open
wags opened this issue Jan 20, 2016 · 6 comments
Open

Running script/test fails #127

wags opened this issue Jan 20, 2016 · 6 comments

Comments

@wags
Copy link
Contributor

wags commented Jan 20, 2016

When I run script/test, I get the following error message:

bundler: command not found: testrb
Install missing gem executables with `bundle install`

This is despite a successful run of script/bootstrap:

Gem environment up-to-date
Installing hooks into /home/administrator/elastomer-client
Successfully installed hooks into /home/administrator/elastomer-client

I installed Ruby 2.2.4 using rbenv on Ubuntu 14.04.

Has anyone encountered this error before? I have not been able to determine if it is a missing gem issue or something else. Thank you!

@chrismwendt
Copy link
Contributor

I haven't encountered this before. Does bundle install fix it?

@wags
Copy link
Contributor Author

wags commented Jan 26, 2016

Unfortunately, no. bundle install runs successfully, but does not install anything new. Do you know which gem supports the testrb command? It looks like that is where it is failing, even though all the dependencies seem to be present.

Here's the output from bundle install on my vm:

Resolving dependencies...
Using rake 10.5.0
Using i18n 0.7.0
Using minitest 4.7.5
Using multi_json 1.11.2
Using thread_safe 0.3.5
Using tzinfo 0.3.46
Using addressable 2.4.0
Using ast 2.2.0
Using bundler 1.11.2
Using ffi 1.9.10
Using safe_yaml 1.0.4
Using multipart-post 2.0.0
Using semantic 1.4.1
Using hashdiff 0.2.3
Using iniparse 1.4.2
Using powerpack 0.1.1
Using rainbow 2.0.0
Using ruby-progressbar 1.7.5
Using activesupport 4.0.13
Using parser 2.3.0.1
Using childprocess 0.5.9
Using crack 0.4.3
Using faraday 0.9.2
Using rubocop 0.36.0
Using overcommit 0.30.0
Using webmock 1.22.6
Using elastomer-client 0.8.1 from source at `.`
Bundle complete! 9 Gemfile dependencies, 27 gems now installed.
Bundled gems are installed into ./vendor/gems.

If you haven't encountered this before, it could be an issue with my environment rather than this project. Do you recommend a method other than rbenv for installing Ruby? I just want to set up a clean development environment to work on Elastomer.

@chrismwendt
Copy link
Contributor

I managed to reproduce the problem after switching from Ruby 2.1.6 to Ruby 2.2.4. Try switching to 2.1.6:

rbenv install 2.1.6
rbenv global 2.1.6

I'm still not sure which gem provides the testrb executable.

@wags
Copy link
Contributor Author

wags commented Jan 26, 2016

Switching to Ruby 2.1.6 solved the problem. There are some understandable errors when I run the script (due to things like _status being deprecated in Elasticsearch 2.x) but it does run.

Thank you for helping get to the bottom of this! 🏆

@chrismwendt
Copy link
Contributor

Cool, the workaround is to just switch to Ruby 2.1.6. However, there is still the problem that script/test doesn't work with Ruby 2.2.4. Since I don't know why it's happening, I'll leave it as an open question for now.

@wags
Copy link
Contributor Author

wags commented Jan 27, 2016

You're right, that's only a workaround. It looks like the breaking change was introduced in Ruby 2.2.0. I installed more versions of Ruby with rbenv and noted my findings below.

Ruby Elastomer script/test minitest test-unit Error
2.1.6 4.7.5 2.1.6.0 -
2.1.7 4.7.5 2.1.7.0 -
2.1.8 4.7.5 2.1.8.0 -
2.2.0 5.4.3 3.0.8 ⚠️
2.2.1 5.4.3 3.0.8 ⚠️
2.2.2 5.4.3 3.0.8 ⚠️
2.2.3 5.4.3 3.0.8 ⚠️
2.2.4 5.4.3 3.0.8 ⚠️
2.3.0 5.8.3 3.1.5 ⚠️

⚠️ rbenv: testrb: command not found
The testrb command exists in these Ruby versions: 2.1.6, 2.1.7, 2.1.8

The minitest and test-unit versions are recorded because I think the issue is related to them changing / being removed from stdlib. (I noticed that minitest is required in test/test_helper.rb)

A few articles cued me in to this.

Ruby 2.2.0 Released
In the Notable Changes since 2.1 section...

bundled libraries:

  • Update test-unit 3.0.8 (removed from repository but bundled in tarball)
  • Update minitest 5.4.3 (removed from repository but bundled in tarball)

Ruby 2.2.0 news

* lib/minitest/*.rb
  * Removed because it conflicts to minitest 5. [Feature #9711]

* lib/test/**/*.rb
  * Removed because it conflicts to minitest 5, and it was just an wrapper
    of minitest 4. [Feature #9711]

This last one—Feature #9711 - Remove test-unit and minitest from stdlib.—is the most interesting.

Note # 14 on that page holds the key:

🔑 bin/testrb: Removed. Forgot to remove in r45971. [Feature #9711]

I am thinking through possible solutions based on these findings next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants