简体   繁体   中英

ionic 3 cannot add onesignal-cordova-plugin into ios platform. Error: rbenv: pod: command not found

I am trying to integrate onesignal to ios. when i execute the command

ionic cordova platform add ios

it fails with the following:

Discovered plugin "onesignal-cordova-plugin" in config.xml. Adding it to the project
Installing "onesignal-cordova-plugin" for ios

Failed to install 'onesignal-cordova-plugin': undefined

Failed to restore plugin "onesignal-cordova-plugin" from config.xml. You might need to try adding it again. Error: rbenv: pod: command not found

The `pod' command exists in these Ruby versions:
  2.1.2

Here is excerpts of my config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.app.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
...
    <plugin name="cordova-plugin-network-information" spec="^1.3.4" />
    <plugin name="onesignal-cordova-plugin" spec="^2.2.5" />
    <engine name="ios" spec="~4.5.4" />
</widget>

You need to install cocoapods for using OneSignal SDK with IOS platform. Check the documentation here

Do:

sudo gem install cocoapods
pod repo update

Suggest you go through this post in case Ruby Gems is not installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM