3

Adding identical pods to each target is redundant.

   def RedundantPod

        pod "Pod"
    end

    target 'targetOne' do
        RedundantPod
    end

    target 'targetTwo' do
        RedundantPod
    end

The following setup throws an error of type: [ ! ] Invalid Podfile file: uninitialized constant. What is wrong here?

Eric
  • 893
  • 10
  • 25

1 Answers1

6

For future readers, the issue comes from the naming RedundantPod which shouldn't start with a capital R.

Indeed, names that start with capital letters are constants in Ruby. It's still possible to use a constant name for a method, but you won't be able to invoke it without parentheses, because the interpeter will look-up for the name as a constant.

You need to either explicitly call the method:

def RedundantPod
   pod "Pod"
end

target 'targetOne' do
   RedundantPod()
end

or rename it without capitalization:

def redundantPod
   pod "Pod"
end

target 'targetOne' do
   redundantPod
end
Amaury Liet
  • 10,196
  • 3
  • 18
  • 24