PhotonView with id has no method marked with PunRPC

I have this code to send info:

using UnityEngine;
using System.Collections;

public class SendAttackInfo : MonoBehaviour {
	public int damage = 100;
	// Use this for initialization
	void Start () {
	
	}
	
	void Update () {
		
		bool RMB = Input.GetMouseButtonDown (1);
		
		if (RMB) {
			
			RaycastHit hit;
			Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
			//&& hit.transform.tag == "Player" && hit.collider.name != this.gameObject.name
			if (Physics.Raycast(ray, out hit)){
				//float dist = Vector3.Distance(hit.transform.position, this.transform.position);
				//if(dist <= 2.0f) {
				PhotonView pv = PhotonView.Get(this);
				if (pv.isMine) {
				hit.collider.gameObject.GetComponent<PhotonView>().RPC("ApplyDamage", PhotonTargets.All);
				}
			}
				//}
			
		}
		
	}
}

And this to recieve:

[PunRPC]
void ApplyDamage(){
	curHealth -= 50;
	Debug.Log("hit player " + curHealth);
}

When I try them I get this error:

PhotonView with ID 1002 has no method “ApplyDamage” marked with the PunRPC or @PunRPC(JS) property! Args:

Please help!

The ApplyDamage method has to be in a script that’s on the same GO as the PhotonView.
This is maybe not the case?

@geotsak, @tobiass is right and addition to this , I had the same issue. When you made any changes in RPC functions in your code or made changes in your prefab , you have to drag your prefab to scene and press apply in inspector, than you can delete it from scene. It resolves this error every time for me.