skip to Main Content

I hadn’t created new RN project in a while and after did some Ruby update and path configuration, I see in my new RN project there is vendor folder in the root.

enter image description here

Without it (tried renaming/deleting the folder) I get this error:

Could not find proper version of cocoapods (1.11.3) in any of the sources
Run `bundle install` to install missing gems.

enter image description here

I did git pull from another laptop and tried to run pod install from ios folder, it doesn’t require bundle install and runs well. How to get the same behavior with no ‘vendor’ folder in the project root?

2

Answers


  1. Chosen as BEST ANSWER

    Turns out I installed both RVM and rbenv which is bad idea. I uninstalled RVM and I fixed the bundler and cocoapods from:

    cd ~
    gem install bundler
    sudo gem uninstall cocoapods
    gem install cocoapods
    

    I removed 'vendor' folder and go to ios folder and did 'pod install'. Now it's working fine, it doesn't generate 'vendor' folder.


  2. What you’re describing is expected behavior (see https://github.com/facebook/react-native/pull/32303). The vendor directory holds project dependencies (like 3rd party files and other code your project references that you didn’t write). It is common for things like install commands (which fetch dependencies) to store content the project needs to reference in this directory so it’s locally available to the project. It is also common best practice to add vendor paths to the project’s git ignore file to ensure dependency code is not committed with the project.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search