-1

I attempted to install the twitter gem onto my Mac via the Terminal app. However, upon typing gem install twitter, I get errors as shown in the image below:

The error given by the Terminal app

Any solutions on how to eliminate this issue?

Todd A. Jacobs
  • 81,402
  • 15
  • 141
  • 199
apple
  • 35
  • 7
  • 2
    You don't have the sudo privilege I guess, try using "sudo gem install twitter" and see what happens! – Sharif Mamun Feb 10 '15 at 21:08
  • 1
    Possible duplicate of [Installing gem or updating RubyGems fails with permissions error](http://stackoverflow.com/questions/14607193/installing-gem-or-updating-rubygems-fails-with-permissions-error) – Mike Mar 14 '16 at 20:05

2 Answers2

3

Why You're Experiencing Write Problems

You have ecountering a write permissions error because the user account you're using doesn't have write permissions to the system library where your current Ruby is storing its gems.

Don't Use Sudo When Installing Rubygems

You should never write to system directories when installing gems. Instead, use a Ruby version manager like rvm, rbenv, or chruby to manage your interpreters and install gems in user-writable directories.

There are numerous security and stability problems that you will inevitably encounter if you insist on abusing your system Ruby interpreter, especially on OS X. Don't do it.

Todd A. Jacobs
  • 81,402
  • 15
  • 141
  • 199
0

Using sudo gem install twitter does the trick :)

apple
  • 35
  • 7
  • 2
    Ofc it does... but I recommend you to not use sudo [i.e. Don't use the ruby that comes with OSX]. Look for `rbenv` or `rvm` and install ruby in your home enviroment. There are plenty instructions how to do this and why to do it on SO & Google. – radubogdan Feb 10 '15 at 21:14