infinitered / ignite

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more! 9 years of continuous development and counting.
MIT License
17.7k stars 1.4k forks source link

ignite new failing silently when cocoapods is not installed on OSX #1548

Closed MisterFruits closed 4 years ago

MisterFruits commented 4 years ago

I was trying to follow the infinitred tutorial there https://shift.infinite.red/creating-a-trivia-app-with-ignite-bowser-part-1-1987cc6e93a1. I was kind of stuck because the ignite new IgniteTrivia --boilerplate bowser --no-detox (which run without error message and returning 0) doesn't seems to generate some important folder (app/models, app/screens etc). I'm just seeing:

in ~/dev/IgniteTrivia/IgniteTrivia
$ ll
total 712
drwxr-xr-x   20 moita  staff   640B Apr 15 20:11 ./
drwxr-xr-x    6 moita  staff   192B Apr 15 20:09 ../
-rw-r--r--    1 moita  staff   114B Apr 15 20:11 .buckconfig
-rw-r--r--    1 moita  staff    74B Apr 15 20:11 .eslintrc.js
-rw-r--r--    1 moita  staff   2.1K Apr 15 20:11 .flowconfig
-rw-r--r--    1 moita  staff    16B Apr 15 20:11 .gitattributes
-rw-r--r--    1 moita  staff   813B Apr 15 20:11 .gitignore
-rw-r--r--    1 moita  staff   120B Apr 15 20:11 .prettierrc.js
-rw-r--r--    1 moita  staff     2B Apr 15 20:11 .watchmanconfig
-rw-r--r--    1 moita  staff   2.7K Apr 15 20:11 App.js
drwxr-xr-x    3 moita  staff    96B Apr 15 20:11 __tests__/
drwxr-xr-x    9 moita  staff   288B Apr 15 20:11 android/
-rw-r--r--    1 moita  staff    61B Apr 15 20:11 app.json
-rw-r--r--    1 moita  staff    77B Apr 15 20:11 babel.config.js
-rw-r--r--    1 moita  staff   183B Apr 15 20:11 index.js
drwxr-xr-x    8 moita  staff   256B Apr 15 20:11 ios/
-rw-r--r--    1 moita  staff   300B Apr 15 20:11 metro.config.js
drwxr-xr-x  651 moita  staff    20K Apr 15 20:12 node_modules/
-rw-r--r--    1 moita  staff   675B Apr 15 20:12 package.json
-rw-r--r--    1 moita  staff   301K Apr 15 20:12 yarn.lock

Thanks to Jamon Holmgren on your slack! We ran the new --debug command and it prompted if I wanted to install cocoapods (with homebrew or gem, but without the option of not installing it). Thus I asked with homebrew and it failed because I don't have it (it would have failed with gem as well since the process didn't have the sudo). Then the entire process failed and I got the same result as described above.

I installed cocoapods manualy, ran the new again and now it seems to be fine (I got all the screens/models/... directories in the app).

Meanwhile I still have a question, I just managed to install an old version of cocoapods, 1.8.4. Is it fine ?

Some question remaining so you can improve ignite:


Ignite installed on OSX

On a fresh ignite new IgniteTrivia --boilerplate bowser --no-detox before installing cocoapods:

$ ignite doctor
System
  platform           darwin                                                  
  arch               x64                                                     
  cpu                4 cores        Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz 
  directory          IgniteTrivia   /Users/moita/dev/IgniteTrivia            

JavaScript
  node               12.16.2      /opt/local/bin/node 
  npm                6.14.4       /opt/local/bin/npm  
  yarn               1.22.4       /opt/local/bin/yarn 

Ignite
  ignite-cli         3.5.1        /opt/local/bin/ignite                        
  ignite src         build        /opt/local/lib/node_modules/ignite-cli/build 
  generators         {"component":"ignite-bowser","model":"ignite-bowser","navigator":"ignite-bowser","screen":"ignite-bowser"}                                                

Android
  java               1.8.0_152-release   /usr/bin/java 
  android home       -                   undefined     

iOS
  xcode              11.2.1     
  cocoapods          Not installed   
bryanstearns commented 4 years ago

Cocoapods is a prerequisite depending on the boilerplate you're using and the options you give it; React Native 0.60 (or later) demands it, when not using Expo.

ignite doctor is already telling you that cocoapods isn't installed, and since it's up to the boilerplate to decide, I'm closing this, but I'll open a PR shortly for Bowser (our primary supported boilerplate) to have it give a clear error message when cocoapods is needed but not installed.