Any of these solutions may work. These are the first two things you should try.
1. Restart your Mac and try again. If this fails,
2. Try the following (courtesy of Treehouse): Open Disk Utility Select Macintosh HD Click Restore Disk Permissions. Reboot Mac
Adding Other people also respond here.
Marco S.- Just log in to sudo su in the terminal, and then you can run the rail installer. I also had the same problem.
Aaron - I got the same error message. After rebooting the computer and retrying the installation, it worked fine. Hover over your mouse.
Kurtis - I had the same problem, and as Aaron said, restarting can fix it. This is not for me, so I took another step and changed the preference for downloading applications ("System Preferences"> "Security and Privacy") "Allow downloading applications from:" to "Anywhere", restarted the computer and installed it just fine.
Towhid Zaman
source share