fastlane: [Regression] Change from colored to colored2 dependency broke usage of `underline`

New Issue Checklist

Issue Description

After release 2.14.0 which incorporated changes from #8028, our CI builds (which update fastlane before building) started failing. After some digging it looks like this might be because the colored2 gem changed the underline effect key (file in colored) to underlined (file in colored2)

Complete output when running fastlane, including the stack trace and command used
[15:19:15]: -------------------------------------------------
[15:19:15]: --- Step: Verifying required fastlane version ---
[15:19:15]: -------------------------------------------------
[15:19:15]: Your fastlane version 2.14.0 matches the minimum requirement of 1.49.0  ✅
[15:19:15]: ------------------------------
[15:19:15]: --- Step: default_platform ---
[15:19:15]: ------------------------------
[15:19:15]: Driving the lane 'ios test' 🚀
[15:19:15]: ------------------
[15:19:15]: --- Step: scan ---
[15:19:15]: ------------------
+------------------+----------+
|        Lane Context         |
+------------------+----------+
| DEFAULT_PLATFORM | ios      |
| PLATFORM_NAME    | ios      |
| LANE_NAME        | ios test |
+------------------+----------+
[15:19:15]: undefined method `underline' for "\e[36m$ xcodebuild -list -workspace XXXXXXX.xcworkspace\e[0m":String
Did you mean?  underlined
               underlined!

+------+-------------------------------------+-------------+
|                     fastlane summary                     |
+------+-------------------------------------+-------------+
| Step | Action                              | Time (in s) |
+------+-------------------------------------+-------------+
| 1    | Verifying required fastlane version | 0           |
| 2    | default_platform                    | 0           |
| 💥   | scan                                | 0           |
+------+-------------------------------------+-------------+

[15:19:15]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

Found no similar issues. To create a new issue, please visit:
https://github.com/fastlane/fastlane/issues/new
Run `fastlane env` to append the fastlane environment to your issue
/Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb:59:in `command': [!] undefined method `underline' for "\e[36m$ xcodebuild -list -workspace XXXXXXX.xcworkspace\e[0m":String (NoMethodError)
Did you mean?  underlined
               underlined!
Did you mean?  underlined
               underlined!
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane_core/lib/fastlane_core/ui/ui.rb:14:in `method_missing'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane_core/lib/fastlane_core/project.rb:407:in `run_command'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane_core/lib/fastlane_core/project.rb:367:in `raw_info'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane_core/lib/fastlane_core/project.rb:439:in `parsed_info'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane_core/lib/fastlane_core/project.rb:102:in `schemes'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane_core/lib/fastlane_core/project.rb:110:in `select_scheme'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/scan/lib/scan/detect_values.rb:22:in `set_additional_default_values'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/scan/lib/scan.rb:26:in `config='
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/actions/scan.rb:15:in `run'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:239:in `block (2 levels) in execute_action'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:217:in `block in execute_action'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:213:in `chdir'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:213:in `execute_action'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:135:in `trigger_action_by_name'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/fast_file.rb:146:in `method_missing'
	from Fastfile:51:in `block (2 levels) in parsing_binding'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/lane_manager.rb:52:in `cruise_lane'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/command_line_handler.rb:30:in `handle'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/commands_generator.rb:105:in `block (2 levels) in run'
	from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
	from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/commander-4.4.0/lib/commander/command.rb:153:in `run'
	from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/commander-4.4.0/lib/commander/runner.rb:444:in `run_active_command'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'
	from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/commander-4.4.0/lib/commander/delegates.rb:15:in `run!'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/commands_generator.rb:302:in `run'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/commands_generator.rb:42:in `start'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/fastlane/lib/fastlane/cli_tools_distributor.rb:59:in `take_off'
	from /Users/distiller/.gem/ruby/2.3.1/gems/fastlane-2.14.0/bin/fastlane:15:in `<top (required)>'
	from /Users/distiller/.gem/ruby/2.3.1/bin/fastlane:23:in `load'
	from /Users/distiller/.gem/ruby/2.3.1/bin/fastlane:23:in `<main>'

Environment

Please run fastlane env and copy the output below. This will help us help you 👍 If you used --capture_output option please remove this block - as it is already included there.

I connected to a re-build on CircleCI via SSH and ran fastlane env, which outputs the following. I deliberately didn’t run this from the project root, and so the Appfile and Fastfiles, which contain client-specific information, aren’t included. I’m pretty sure this issue isn’t project-specific though.

[15:27:56]: Generating fastlane environment output, this might take a few seconds...
<details><summary>✅ fastlane environment ✅</summary>

### Stack

| Key                 | Value                                           |
| ------------------- | ----------------------------------------------- |
| OS                  | 10.11.6                                         |
| Ruby                | 2.3.1                                           |
| Bundler?            | false                                           |
| Git                 | git version 2.10.2                              |
| Installation Source | ~/.gem/ruby/2.3.1/bin/fastlane                  |
| Host                | Mac OS X 10.11.6 (15G1108)                      |
| Ruby Lib Dir        | /opt/rubies/ruby-2.3.1/lib                      |
| OpenSSL Version     | OpenSSL 1.0.2j  26 Sep 2016                     |
| Is contained        | false                                           |
| Is homebrew         | false                                           |
| Xcode Path          | /Applications/Xcode-8.2.app/Contents/Developer/ |
| Xcode Version       | 8.2.1                                           |


### System Locale

| Variable | Value       |   |
| -------- | ----------- | - |
| LANG     | en_CA.UTF-8 | ✅ |
| LC_ALL   |             |   |
| LANGUAGE |             |   |


### fastlane files:

**No Fastfile found**


**No Appfile found**


### fastlane gems

| Gem      | Version | Update-Status |
| -------- | ------- | ------------- |
| fastlane | 2.14.0  | ✅ Up-To-Date  |


### Loaded fastlane plugins:

**No plugins Loaded**


<details><summary><b>Loaded gems</b></summary>

| Gem                       | Version      |
| ------------------------- | ------------ |
| did_you_mean              | 1.0.2        |
| slack-notifier            | 1.5.1        |
| CFPropertyList            | 2.3.4        |
| claide                    | 1.0.1        |
| colored                   | 1.2          |
| nanaimo                   | 0.2.2        |
| xcodeproj                 | 1.4.1        |
| rouge                     | 1.11.1       |
| xcpretty                  | 0.2.4        |
| terminal-notifier         | 1.7.1        |
| public_suffix             | 2.0.4        |
| addressable               | 2.5.0        |
| multipart-post            | 2.0.0        |
| word_wrap                 | 1.0.0        |
| babosa                    | 1.0.2        |
| colored2                  | 3.1.1        |
| highline                  | 1.7.8        |
| commander                 | 4.4.0        |
| excon                     | 0.54.0       |
| unf_ext                   | 0.0.7.2      |
| unf                       | 0.1.4        |
| domain_name               | 0.5.20161021 |
| http-cookie               | 1.0.3        |
| faraday-cookie_jar        | 0.0.6        |
| gh_inspector              | 1.0.2        |
| uber                      | 0.0.15       |
| representable             | 2.3.0        |
| retriable                 | 2.1.0        |
| mime-types-data           | 3.2016.0521  |
| mime-types                | 3.1          |
| hurley                    | 0.2          |
| faraday                   | 0.10.0       |
| little-plugger            | 1.1.4        |
| multi_json                | 1.12.1       |
| logging                   | 2.1.0        |
| jwt                       | 1.5.6        |
| memoist                   | 0.15.0       |
| os                        | 0.9.6        |
| signet                    | 0.7.3        |
| googleauth                | 0.5.1        |
| httpclient                | 2.8.2.4      |
| google-api-client         | 0.9.20       |
| mini_magick               | 4.5.1        |
| multi_xml                 | 0.5.5        |
| security                  | 0.1.3        |
| xcpretty-travis-formatter | 0.0.4        |
| dotenv                    | 2.1.1        |
| bundler                   | 1.13.6       |
| faraday_middleware        | 0.10.1       |
| i18n                      | 0.7.0        |
| json                      | 1.8.3        |
| thread_safe               | 0.3.5        |
| tzinfo                    | 1.2.2        |
| activesupport             | 4.2.7.1      |
| io-console                | 0.4.6        |
| rubyzip                   | 1.2.0        |
| plist                     | 3.2.0        |
| unicode-display_width     | 1.1.1        |
| terminal-table            | 1.7.3        |
</details>


*generated on:* **2017-02-02**
</details>
[15:27:56]: Open https://github.com/fastlane/fastlane/issues/new to submit a new issue ✅

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 20 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Really sorry everyone, and thanks for the PR, just waiting for CI to pass, expect a new release in about 10 minutes. Sorry again, we’ll make sure to add more tests to also catch this error in the future 👍

This is the first time I’ve tried to contribute to fastlane so I’m doing a bit of setup, but I think this should be a fairly straightforward change and hope to have a PR up soon.

@drosenstark so in my case I use bundler to manually specify the gems in just a single folder. It helps if you use various ruby projects and you don’t want them to step on each others toes. If you don’t do that you should just manually install version 2.0.2 of the ruby gem colored2 eg: gem install colored2 -v 2.0.2

The new release is live 2.14.1, please update to the most recent version and let me know if that fixes the problem.

Again, I’m super sorry this happened, we’ll add more tests to cover this area as well 👍

@jasonmerino That worked, thanks!

I’m running into this as well after just upgrading fastlane, however, instead of mine breaking on a scan action mine is breaking on the increment_build_number action.

[15:33:02]: -------------------------------------------------
[15:33:02]: --- Step: Verifying required fastlane version ---
[15:33:02]: -------------------------------------------------
[15:33:02]: Your fastlane version 2.14.0 matches the minimum requirement of 1.39.0  ✅
[15:33:02]: ------------------------------
[15:33:02]: --- Step: default_platform ---
[15:33:02]: ------------------------------
[15:33:02]: Driving the lane 'ios beta' 🚀
[15:33:02]: ------------------------------------
[15:33:02]: --- Step: increment_build_number ---
[15:33:02]: ------------------------------------
[15:33:02]: Before being able to increment and read the version number from your Xcode project, you first need to setup your project properly. Please follow the guide at https://developer.apple.com/library/content/qa/qa1827/_index.html
+------------------+----------+
|        Lane Context         |
+------------------+----------+
| DEFAULT_PLATFORM | ios      |
| PLATFORM_NAME    | ios      |
| LANE_NAME        | ios beta |
+------------------+----------+
[15:33:02]: undefined method `underline' for #<String:0x007fbffb9d36a0>

+------+-------------------------------------+-------------+
|                     fastlane summary                     |
+------+-------------------------------------+-------------+
| Step | Action                              | Time (in s) |
+------+-------------------------------------+-------------+
| 1    | Verifying required fastlane version | 0           |
| 2    | default_platform                    | 0           |
| 💥   | increment_build_number              | 0           |
+------+-------------------------------------+-------------+

[15:33:02]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

➡️  [Regression] Change to colored2 dependency broke usage of `underline`
   https://github.com/fastlane/fastlane/issues/8093 [open] 0 💬
   21 seconds ago

🔗  You can ⌘ + double-click on links to open them directly in your browser.
/Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb:59:in `command': [!] undefined method `underline' for #<String:0x007fbffb9d36a0> (NoMethodError)
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane_core/lib/fastlane_core/ui/ui.rb:14:in `method_missing'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/helper/sh_helper.rb:29:in `sh_control_output'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/helper/sh_helper.rb:10:in `sh'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/actions/increment_build_number.rb:43:in `run'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:239:in `block (2 levels) in execute_action'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:217:in `block in execute_action'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:213:in `chdir'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:213:in `execute_action'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:135:in `trigger_action_by_name'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/fast_file.rb:146:in `method_missing'
	from Fastfile:41:in `block (2 levels) in parsing_binding'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/lane_manager.rb:52:in `cruise_lane'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/command_line_handler.rb:30:in `handle'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/commands_generator.rb:105:in `block (2 levels) in run'
	from /Library/Ruby/Gems/2.0.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
	from /Library/Ruby/Gems/2.0.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
	from /Library/Ruby/Gems/2.0.0/gems/commander-4.4.0/lib/commander/command.rb:153:in `run'
	from /Library/Ruby/Gems/2.0.0/gems/commander-4.4.0/lib/commander/runner.rb:444:in `run_active_command'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'
	from /Library/Ruby/Gems/2.0.0/gems/commander-4.4.0/lib/commander/delegates.rb:15:in `run!'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/commands_generator.rb:302:in `run'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/commands_generator.rb:42:in `start'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/fastlane/lib/fastlane/cli_tools_distributor.rb:59:in `take_off'
	from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.14.0/bin/fastlane:15:in `<top (required)>'
	from /usr/local/bin/fastlane:23:in `load'
	from /usr/local/bin/fastlane:23:in `<main>'

This error message says Before being able to increment and read the version number from your Xcode project, you first need to setup your project properly. but there are no Xcode project changes since I was previously able to build.