bamlab / fastlane-plugin-cordova

Integrate your Cordova build into your Fastlane setup
MIT License
115 stars 39 forks source link

An error occurred while installing json (2.1.0), and Bundler cannot continue. #2

Open ccorcos opened 7 years ago

ccorcos commented 7 years ago

Any ideas? I'm not a Ruby person... :/

~/C/n/src ❯❯❯ mkdir fastlane
touch fastlane/Appfile fastlane/Fastfile
~/C/n/src ❯❯❯ fastlane add_plugin cordova    

[17:24:36]: Plugin 'fastlane-plugin-cordova' was added to './fastlane/Pluginfile'
[17:24:36]: It looks like fastlane plugins are not yet set up for this project.
[17:24:36]: fastlane will create a new Gemfile at path 'Gemfile'
[17:24:36]: This change is necessary for fastlane plugins to work
[17:24:36]: Should fastlane modify the Gemfile at path 'Gemfile' for you? (y/n)
y
[17:24:38]: Successfully modified 'Gemfile'
[17:24:38]: 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/chet/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
/Users/chet/.fastlane/bin/bundle/bin/ruby -r ./siteconf20170503-985-h4e4pe.rb extconf.rb
creating Makefile

current directory: /Users/chet/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /Users/chet/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/json-2.1.0/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
clang: warning: no such sysroot directory: '/Applications/Xcode-7.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk' [-Wmissing-sysroot]
In file included from generator.c:1:
In file included from ./../fbuffer/fbuffer.h:5:
In file included from /Users/chet/.fastlane/bin/bundle/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/chet/.fastlane/bin/bundle/include/ruby-2.2.0/ruby/ruby.h:29:
/Users/chet/.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.
make: *** [generator.o] Error 1

make failed, exit code 2

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

An error occurred while installing json (2.1.0), and Bundler cannot continue.
Make sure that `gem install json -v '2.1.0'` succeeds before bundling.
Almouro commented 7 years ago

There seems to be a solution on this issue, does it fix your problem? :)

odeann commented 7 years ago

@ccorcos It happens when you installed fastlane to the ~/.fastlane directory (via homebrew or using the official installer). Try to uninstall fastlane first (or delete ~/.fastlane directory, but anyway, don't forget to remove export PATH="$HOME/.fastlane/bin:$PATH" line in ~/.bash_profile) and then install fastlane with gem:

sudo gem install fastlane -NV

It will help.

Almouro commented 7 years ago

Hi @ccorcos, did odeann's answer fix your problem? I'm closing this issue since there was no activity for a while, but feel free to reopen if it didn't fix it :)

ccorcos commented 7 years ago

I never ended up using fastlane :(

Almouro commented 7 years ago

@ccorcos ah out of curiosity, what did you end up using for deployment? :)

ccorcos commented 7 years ago

I just archive and upload straight from Xcode.

mdanics commented 7 years ago

@ccorcos @Almouro have the same problem, the solutions didn't work

odeann commented 7 years ago

@mdanics @ccorcos Just out of curiosity: What does which fastlane says?

wootwoot1234 commented 7 years ago

@Almouro I'm getting this error too. I don't think this is solved and this issue should be reopened.

Almouro commented 7 years ago

In this issue there is a suggestion by one of the Fastlane owners:

rm -rf ~/.Fastlane
gem update fastlane

Does it work for you? If it doesn't can you output which fastlane?

wootwoot1234 commented 7 years ago

@Almouro, thanks for the help.

This is what I got:

MacBook-Pro:App Tom$ rm -rf ~/.Fastlane
MacBook-Pro:App Tom$ gem update fastlane
Updating installed gems
Nothing to update
MacBook-Pro:App Tom$ fastlane beta
-bash: /Users/Tom/.fastlane/bin/fastlane: No such file or directory

and which fastlane returns nothing...

I think I installed fastlane with the following command:

brew cask install fastlane

I wonder if it has to do with the install method?

Almouro commented 7 years ago

You're right, it could have to do with the install method.

What if you do:

gem install fastlane

And then try your lane?

wootwoot1234 commented 7 years ago

Ok, this is what I did and where I'm at now:

I uninstalled fastlane using brew:

brew cask uninstall fastlane

removed this line from my '~/.bash_profile' per the instructions in terminal after the uninstall:

export PATH="$HOME/.fastlane/bin:$PATH"

I am using rbenv so I set my global ruby to system (otherwise you'll get errors when using fastlane):

rbenv global system

installed fastlane using the following command, as recommended on the fastlane site:

sudo gem install fastlane -NV

I closed and reopened terminal.

Then I navigated to my project directory.

I installed the plugin:

fastlane add_plugin cordova

It installed with no errors and so I ran deploy:

fastlane deploy

But I get the following error (seems like it's trying to install it again?):

MacBook-Pro:App Tom$ fastlane deploy
/Library/Ruby/Gems/2.0.0/gems/fastimage-2.1.0/lib/fastimage.rb:67: warning: already initialized constant URI::DEFAULT_PARSER
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/common.rb:545: warning: previous definition of DEFAULT_PARSER was here
[10:22:50]: fastlane detected a Gemfile in the current directory
[10:22:50]: however it seems like you don't use `bundle exec`
[10:22:50]: to launch fastlane faster, please use
[10:22:50]:
[10:22:50]: $ bundle exec fastlane deploy
[10:22:50]:
[10:22:50]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
[10:22:53]: Installing Ruby gem 'fastlane-plugin-cordova'...
[10:23:55]: Error loading plugin 'fastlane-plugin-cordova': undefined method `install_gem' for #<Gem::Commands::InstallCommand:0x007fd8c87d4350>
[10:23:55]: It seems like you wanted to load some plugins, however they couldn't be loaded
[10:23:55]: Please follow the troubleshooting guide: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md
+-------------------------+-----------+------------------+
|                      Used plugins                      |
+-------------------------+-----------+------------------+
| Plugin                  | Version   | Action           |
+-------------------------+-----------+------------------+
| fastlane-plugin-cordova | undefined | No actions found |
+-------------------------+-----------+------------------+
pokono commented 7 years ago

+1