Reputation: 1849
I am literally new to Ruby. This is my first day and naturally it starts with installing it on my machine.
I am using Mac os El Capitan. It already shipped with ruby so I just updated it, installed the rvm & gem and tried to install rails using the following commands:
rvm get head
sudo gem update --system
sudo gem install rails
The last command (installing rails) is giving me the following error:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/rackup
Any idea what is it and how to fix it? I have found couple of questions on stackoverflow with similar, but not the same error, but I didn't even understand the answers. Again I am really a novice here.
Edit:
I keep getting comments that this is a duplicate question. However it is not giving me the same error as in the other questions. Please if anyone knows what is this error about, or whether it's really the same error, explain why, otherwise I don't see a reason why you should mark the question as duplicate without understanding the error message.
Upvotes: 2
Views: 2250
Reputation: 845
My advice is to install rbenv. Later you can easily switch between ruby versions
brew install rbenv ruby-build
# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
# Install Ruby
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v
And then install rails
gem install rails -v 4.2.6
rbenv rehash
rails -v
# Rails 4.2.6
Upvotes: 1