SiarheiFedartsou / fastlane-plugin-versioning

Extends fastlane versioning actions. Allows to set/get versions without using agvtool and do some other small tricks.
MIT License
504 stars 60 forks source link

Error Installing Extension #9

Closed bangonkali closed 7 years ago

bangonkali commented 7 years ago

Command used: fastlane add_plugin versioning

user@computer:~$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 10.12.4 (16E195)
      Kernel Version: Darwin 16.5.0
      Boot Volume: Mac
      Boot Mode: Normal
      Computer Name: computer
      User Name: <redacted>
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 1 day 15:41

I'm encountering an error installing this extension due to a Gem requirement.

user@computer:~/Downloads/wkd-native-master$ fastlane add_plugin versioning
+----------------------------+---------+------------------------------------+
|                               Used plugins                                |
+----------------------------+---------+------------------------------------+
| Plugin                     | Version | Action                             |
+----------------------------+---------+------------------------------------+
| fastlane-plugin-versioning | 0.2.6   | get_app_store_version_number       |
|                            |         | get_build_number_from_plist        |
|                            |         | get_info_plist_path                |
|                            |         | get_version_number_from_git_branch |
|                            |         | get_version_number_from_plist      |
|                            |         | increment_build_number_in_plist    |
|                            |         | increment_version_number_in_plist  |
+----------------------------+---------+------------------------------------+

[18:20:07]: Make sure to commit your Gemfile, Gemfile.lock and Pluginfile to version control
Installing plugin dependencies...
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/user/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/unf_ext-0.0.7.3/ext/unf_ext
/Users/user/.fastlane/bin/bundle/bin/ruby -r ./siteconf20170414-18783-16bj6os.rb extconf.rb 
checking for main() in -lstdc++... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/user/.fastlane/bin/bundle/bin/$(RUBY_BASE_NAME)
    --with-static-libstdc++
    --without-static-libstdc++
    --with-stdc++lib
    --without-stdc++lib
/Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable
file. (RuntimeError)
You have to install development tools first.
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:735:in `try_func'
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:966:in `block in have_library'
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:321:in `open'
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:321:in `open'
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
    from /Users/user/.fastlane/bin/bundle/lib/ruby/2.2.0/mkmf.rb:961:in `have_library'
    from extconf.rb:6:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/user/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/unf_ext-0.0.7.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/user/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/unf_ext-0.0.7.3 for
inspection.
Results logged to
/Users/user/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/unf_ext-0.0.7.3/gem_make.out

An error occurred while installing unf_ext (0.0.7.3), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.7.3'` succeeds before bundling.

Logs:

user@computer:~/Downloads/wkd-native-master$ cat /Users/user/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/unf_ext-0.0.7.3/mkmf.log
"/usr/bin/clang -o conftest -I/Users/user/.fastlane/bin/bundle/include/ruby-2.2.0/x86_64-darwin15 -I/Users/user/.fastlane/bin/bundle/include/ruby-2.2.0/ruby/backward -I/Users/user/.fastlane/bin/bundle/include/ruby-2.2.0 -I. -I/Users/crashlytics/buildAgent/work/2484be8b71880c21/bundle-2.13.0/fastlane_lib/dependencies/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -mmacosx-version-min=10.10 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -pipe conftest.c  -L. -L/Users/user/.fastlane/bin/bundle/lib -L. -L/Users/crashlytics/buildAgent/work/2484be8b71880c21/bundle-2.13.0/fastlane_lib/dependencies/lib -fstack-protector     -lruby-static -framework CoreFoundation  -lpthread -ldl -lobjc "
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk' [-Wmissing-sysroot]
In file included from conftest.c:1:
In file included from /Users/user/.fastlane/bin/bundle/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/user/.fastlane/bin/bundle/include/ruby-2.2.0/ruby/ruby.h:29:
/Users/user/.fastlane/bin/bundle/include/ruby-2.2.0/ruby/defines.h:26:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

I don't have MacOSX10.11.sdk but i do have:

user@computer:~/Downloads/wkd-native-master$ ls '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk'
SDKSettings.plist System            usr
bangonkali commented 7 years ago

Fixed on my end. There was an issue with gem only running on sudo.

Steps to Fix the Problem

  1. Do not us sudo in any of the following steps
  2. Make sure that your Mac DO NOT have rvm installed.
    user@computer:~$ rvm --version
    -bash: rvm: command not found
  3. Install rbenv.
  4. Install rbenv-ruby-build extension.
  5. Ruby Version 2.4.1. After installing ruby-build, you can issue command rbenv install 2.4.1 on terminal.
  6. Set the global ruby version to 2.4.1 by issuing command rbenv global 2.4.1.
  7. Install ruby gem 2.6.11 or above. Install Instructions.
  8. Make sure to rehash the ruby environment variables rbenv rehash.
  9. Install bundler gem install bundler.
joaom182 commented 5 years ago

@bangonkali Following your steps, now i have the following error:

Errno::EACCES: Permission denied @ rb_sysopen - /Users/joaom182/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/unf_ext-0.0.7.5/.document
An error occurred while installing unf_ext (0.0.7.5), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.7.5'` succeeds before bundling.
bangonkali commented 5 years ago

@joaom182 we could be dealing with a different issue.