why isn't the pod file working?!

I have an Xcode project and im integrating admobs to it and as a part of that ive used firebase and cocoa pods. after finding the Xcode project on the terminal and making the changes to the pod file when type 'pod install' as the tutorial tells me too I get this error code:

[!] Invalid Podfile file: undefined method `Pod' for #Pod::Podfile:0x00007fcd953068c0.

has anyone had this before and what can I do to resolve this?