fastlane: Unable to activate krausefx-shenzhen-0.14.9, because json-2.0.1 conflicts with json (~> 1.8)

New Issue Checklist

Issue Description

After adding a lane (tag_jira) I now get an exception every time I use fastlane, but only on my Xcode Server. Running the lanes manually on my machine work.

Complete output when running fastlane, including the stack trace and command used

Xcode Server Trigger:

#!/bin/bash
PATH=/usr/local/bin:$PATH
cd "$XCS_SOURCE_DIR/RealmEngagement.iOS"

fastlane after_integration --verbose

Output:

DEBUG [2016-07-13 06:06:24.40]: Checking if there are any plugins that should be loaded...
INFO [2016-07-13 06:06:24.48]: -------------------------------------------------
INFO [2016-07-13 06:06:24.48]: --- Step: Verifying required fastlane version ---
INFO [2016-07-13 06:06:24.48]: -------------------------------------------------
INFO [2016-07-13 06:06:24.48]: fastlane version valid
INFO [2016-07-13 06:06:24.50]: ------------------------------
INFO [2016-07-13 06:06:24.50]: --- Step: default_platform ---
INFO [2016-07-13 06:06:24.50]: ------------------------------
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:2288:in `raise_if_conflicts': Unable to activate krausefx-shenzhen-0.14.9, because json-2.0.1 conflicts with json (~> 1.8) (Gem::ConflictError)
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1408:in `activate'
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:89:in `block in require'
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:88:in `each'
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:88:in `require'
    from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.97.2/lib/fastlane/lane_manager.rb:156:in `load_dot_env'
    from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.97.2/lib/fastlane/lane_manager.rb:41:in `cruise_lane'
    from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.97.2/lib/fastlane/command_line_handler.rb:30:in `handle'
    from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.97.2/lib/fastlane/commands_generator.rb:51:in `block (2 levels) in run'
    from /usr/local/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    from /usr/local/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'
    from /usr/local/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'
    from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane_core-0.48.1/lib/fastlane_core/ui/fastlane_runner.rb:26:in `run!'
    from /usr/local/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'
    from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.97.2/lib/fastlane/commands_generator.rb:244:in `run'
    from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.97.2/lib/fastlane/commands_generator.rb:20:in `start'
    from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.97.2/lib/fastlane/cli_tools_distributor.rb:47:in `take_off'
    from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.97.2/bin/fastlane:5:in `<top (required)>'
    from /usr/local/bin/fastlane:22:in `load'
    from /usr/local/bin/fastlane:22:in `<main>'
    from /usr/local/bin/ruby_executable_hooks:15:in `eval'
    from /usr/local/bin/ruby_executable_hooks:15:in `<main>'

Configuration Files

Please copy the complete content of your Fastfile and any other configuration files you use below:

Fastfile:

fastlane_version "1.91.0"

default_platform :ios

platform :ios do
  before_all do
    ENV["GYM_SCHEME"] = "Engagement"

    ENV["HIPCHAT_API_TOKEN"] = "XXX"
    ENV["FL_HIPCHAT_CHANNEL"] = "XXX"
    ENV["HIPCHAT_API_VERSION"] = "2"
    ENV["FL_HIPCHAT_FROM"] = ENV["XCS_BOT_NAME"]

    ENV["CRASHLYTICS_API_TOKEN"] = "XXX"
    ENV["CRASHLYTICS_BUILD_SECRET"] = "XXX"

    ENV["IDENTIFIER"] = "com.acstechnologies.Realm.Engagement"
  end

  desc "Runs all the tests"
  lane :test do
    scan
  end

  desc "Setup for Xcode Server integration"
  lane :before_integration do
    update_xcode_server_profiles
  end

  lane :update_xcode_server_profiles do
    ENV["SIGH_OUTPUT_PATH"] = "/Library/Developer/XcodeServer/ProvisioningProfiles"
    ENV["SIGH_SKIP_INSTALL"] = "true"

    sigh(adhoc: true)
    sigh(development: true)
    sigh() # production
  end

  desc "Clean up and complete Xcode Server integration"
  lane :after_integration do
    if ENV["XCS_PRODUCT"]
      # crashlytics(ipa_path: ENV["XCS_PRODUCT"], groups: "qa")
      pilot(ipa: ENV["XCS_PRODUCT"], skip_waiting_for_build_processing: true)

      tag_jira
    end

    notify_hipchat
  end

  desc "Submit a new Beta Build to Crashlytics and TestFlight"
  lane :beta do
    gym
    crashlytics(groups: "qa")
    pilot
  end

  desc "Send a message to the HipChat room about the integration result."
  lane :notify_hipchat do
    ip = `ifconfig en0 | grep inet | grep -v inet6 | awk '{print $2}'`.strip

    message = "<a href=\"http://#{ip}/xcode\">Integration #{ENV['XCS_INTEGRATION_NUMBER']}</a> "

    message += "<strong>"
    message += case ENV['XCS_INTEGRATION_RESULT']
    when "succeeded"
      "succeeded"
    when "warnings"
      "succeeded with build warnings"
    when "analyzer-warnings"
      "succeeded with analyzer warnings"
    when "test-failures"
      "failed tests"
    when "build-errors"
      "failed to build"
    when "trigger-error"
      "trigger failed"
    when "internal-build-error"
      "failed"
    else
      if ENV['XCS_INTEGRATION_RESULT'].include?("error")
        "failed"
      elsif ENV['XCS_INTEGRATION_RESULT'].include?("warnings")
        "succeeded with warnings"
      else
        "finished"
      end
    end
    message += "</strong>"

    color = if ENV['XCS_INTEGRATION_RESULT'].include?("error") || ENV['XCS_INTEGRATION_RESULT'].include?("failures")
      "red"
    elsif ENV['XCS_INTEGRATION_RESULT'].include?("warnings")
      "yellow"
    elsif ENV['XCS_INTEGRATION_RESULT'].include?("succeeded")
      "green"
    else
      "gray"
    end

    error_count = ENV["XCS_ERROR_COUNT"].to_i
    if error_count > 0
      message += " with #{error_count} errors"
    end

    message += "."

    test_count = ENV["XCS_TESTS_COUNT"]
    text_failed = ENV["XCS_TEST_FAILURE_COUNT"]
    if test_count && text_failed
      message += " #{text_failed} of #{test_count} tests failed."
    end

    hipchat(message: message, success: true, custom_color: color, message_format: 'html', include_html_header: false)
  end

  desc "Create a Jira comment with the new build number."
  lane :tag_jira do
    commits = changelog_from_git_commits(merge_commit_filtering: 'exclude_merges')
    tickets = commits.scan(/REALM-\d+/)

    version = `/usr/libexec/plistbuddy -c Print:CFBundleShortVersionString '../Engagement/Info.plist'`.strip

    uri = URI("https://version-bot.herokuapp.com/v1/versions?identifier=#{ENV['IDENTIFIER']}&short_version=#{version}")
    res = Net::HTTP.get_response(uri)
    build = JSON.parse(res.body)['dot']

    tickets.each do | ticket |
      uri = URI("https://jira.acstechnologies.com/rest/api/2/issue/#{ticket}/comment")

      # Create client
      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true
      http.verify_mode = OpenSSL::SSL::VERIFY_PEER

      # Create Request
      req =  Net::HTTP::Post.new(uri)
      req.add_field "Authorization", "Basic XXX"
      req.add_field "Content-Type", "application/json"
      req.body = JSON.dump({
        "body" => "Build #{build}\n\n#{commits}"
      })

      http.request(req)
    end
  end

  # You can define as many lanes as you want

  after_all do |lane|
    # This block is called, only if the executed lane was successful

    # slack(
    #   message: "Successfully deployed new App Update."
    # )
  end

  error do |lane, exception|
    # slack(
    #   message: exception.message,
    #   success: false
    # )
  end
end

Environment

fastlane version (run fastlane -v): 1.97.2 (both locally and on Xcode Server)

Do you use bundler to execute fastlane (i.e. bundle exec fastlane)? No

Do you use a Ruby environment manager (e.g. chruby, rbenv, rvm)? No

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

I have this issue when I updated my gems also. Uninstalling latest json version fixed for me:

$ sudo gem uninstall json

Select gem to uninstall:
 1. json-1.8.3
 2. json-2.0.1
 3. All versions
> 2
Successfully uninstalled json-2.0.1