zsh: command not found: hiptest-publisher - macos

I'm using hiptest-publisher in order to push test results on the cucumber studio platform. The tests run and pass.
I installed Ruby and then ran gem install hiptest-publisher.
When I try to run this command to push the test execution result back to Cucumber Studio:
hiptest-publisher --config-file=<path> --push="target/cucumber.json" --push-format=cucumber-json --test-run-id=123
I receive this error:
Any advice to solve this problem is welcome.
Thanks a lot!

Problem solved!
How did I solve it?
Step 1
$ gem environment
Will tell you the EXECUTABLE DIRECTORY.
Step 2
Put whatever that value is in your PATH in your .bashrc or other shell config file.
export PATH="$PATH:/path/to/bin"
Thank you!

Related

Fastlane update breaks ruby

When I ran a fastlane script to build and upload an ionic app to Hockeyapp, I saw the following message:
# fastlane 2.105.2 is available. You are on 2.103.1.
# You should use the latest version.
# Please update using `bundle update fastlane`.
So I ran bundle update fastlane, which appeared to work fine, but when I tried running my fastlane script again, the following error appeared, which I've never seen before:
Non-system Ruby in use. This may cause packaging to fail.
If you use RVM, please run `rvm use system`.
If you use chruby, please run `chruby system`.
error: archive not found at path '/path-to-app/platforms/ios/appname.xcarchive'
** EXPORT FAILED **
I also saw an extra line appear in the build settings output, which has never been there before:
User defaults from command line:
IDEArchivePathOverride = /Users/debbiefigg/Projects/QuickNurse/quick-nurse-app/platforms/ios/Quick Nurse.xcarchive
I've spent hours going round in circles trying to figure out how to solve this, but have drawn a blank.
Can anyone suggest why this happened and how to solve it?

Rubymine (Ruby): Why can't I run rspec from within the IDE?

If I run the following command from the terminal I am able to run the rspec test cases successfully.
bundle exec rspec spec/requests/api/contacts/v3_get_tags_spec.rb
However if I am in the Rubymine IDE and do:
1- Right click on the file
2- Select "Run"
Then i get the following error message.
"in `require': cannot load such file -- spec_helper (LoadError)"
Also i am seeing a lot of errors related to gems not found, i feel link Rubymine is not configured correctly. What am i missing?
Note: Both the terminal and the IDE are running in the same root directory. I am pretty sure there is a problem with the configuration of the IDE. I checked the preference setting and it is using the same version of ruby as the one I am running in the termina.
Any help on the issue would be greatly appreciated.

Undefined Step Definitions when Running Cucumber scripts in command line

I was previously using RubyMine to run cucumber test scripts and it works just fine, but I am looking for an alternative to run those scripts from command line.
When I try to run a specific .feature file from cmd, I get an error stating that my Ruby step definitions are undefined. I am assuming this is because they are not located in the same directory as the .feature file that I am trying to run.
Here is my cmd output:
Undefined Steps error output
Any suggestions welcome! Thanks
If you're running cucumber from your_directory. Then your .feature files should be in your_directory/features and step definitions (.rb files) in your_directory/features/step_definitions Subfolders are supported.
Look at https://docs.cucumber.io/guides/10-minute-tutorial/
If you're running Win10, check WSL - makes your life better ;-)

Run Ruby Unit Tests(Test::Unit) inside the Code

Does anybody know how I do run a unit test(Test::Unit) within Ruby code itself? I couldn't find anything online to help me out. As we all know, you run unit tests from the command line by executing "ruby your_test_name.rb' I basically don't want to run from the command line but I want to run within the ruby code itself. Does anybody have any ideas? Thanks in advance for all your help.
How can u imagine it?
If you wanna start your code (tests) automatically after changes check out gem guard.
1) Setup guard
Add to your Gemfile
gem 'guard-test'
than run
bundle install
or if you don't use bundle
gem install guard-test
2) Generate guardfile
guard init test
3) Run it
guard
more about guard

Rails 3 -- Rspec

in my rails3 app I have installed rspec. But when I run the rspec command in my console it gives the following error.
C:\myapp>rspec spec
'rspec' is not recognized as an internal or external command,
operable program or batch file.
Please Help.
Thanks in Advance.
You can try
bundle exec rspec spec
It doesnt solve the root problem, but is a quick work-around
EDIT: Did a bit of googling for you, have you tried this? http://getsatisfaction.com/railstutorial/topics/rspec_command_not_found#reply_4313182
You need to add the ruby gems directory to your PATH environment variable.
For me this is "C:\Program Files\Ruby192\lib\ruby\gems", but this will vary depending on version and install directory. You can add it to your PATH variable by going to Computer > System Properties > Advanced System Settings > Environment Variable > Path > Edit. Make sure you don't wipe the existing contents. Instead, add a semi-colon and paste the gems path in.
Good luck.
I did this and it worked
C:\OSS\InSpects>PATH=C:\Ruby192\lib\ruby\gems\1.9.1\bin;C:\Ruby192\bin

Resources