Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Installing a Ruby on Rails Development Environment in Ubuntu

Aya Yousef
Aya Yousef
9,658 Points

Error installing rails

Hi, I've an error in installing rails by this command: $ gem install rails

I get this error message :

Fetching: thread_safe-0.3.5.gem (100%) ERROR: While executing gem ... (Errno::EACCES) Permission denied @ dir_s_mkdir - /var/lib/gems/2.2.0

How can I fix it?

1 Answer

Tim Knight
Tim Knight
28,888 Points

Aya,

You probably just need to tell Rubygems that you have access to check that new system folder and you can do that using sudo. See if that works for you:

$ sudo gem install rails

Then it'll ask you for your password to authenticate.