I am trying to install fastlane. I have Xcode installed. I installed fastlane using the command sudo gem install fastlane. I now go in
fastlane
sudo gem install fastlane
If you are working on local machine then add following to you .bash_profile
export PATH="$HOME/.fastlane/bin:$PATH"
If you are working on Jenkins then this worked for me