Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Ruby Gems Gems In Depth Uninstalling a Gem

Ryan Moxon
Ryan Moxon
37 Points

Bundle install

When I remove the gem 'rollbar' from Gemfile and run bundle install I get the error 'rollbar' has been deleted from the Gemfile.

Ruby scans Gemfile.lock for dependencies and previous gem installatiions which tirggers the error.

2 Answers

Mike Hickman
Mike Hickman
19,817 Points

You can delete your Gemfile.lock, then run bundle install and it will re-generate the Gemfile.lock based on your current Gemfile.

If you don't feel comfortable with that, make a backup copy of your Gemfile.lock first and then do it. Good luck.

Ryan Moxon
Ryan Moxon
37 Points

Thank you for the replies! I figured out that I needed to login as the user instead of root.

I ran bundle install and everything worked great.

Only problem I have is removing a certain gem from the dependencies list now. When I remove the gem from Gemfile and run bundle install I get the 'gem has been deleted' error.

So I may have to delete Gemfile.lock and run bundle install but it's to risky in my situation. My have to run the operations in a development environment.