ruby-on-railscode-cleanup

Best way to reset a ruby on rails project


We have a ruby rails project which we normally get from our enterprise github repository. Recently, I've added dependencies that for some reason breaks my other projects that are not related to the one I was working on. My questions are

  1. Does "bundle install" saves the dependencies globally? or can it behave like the npm to install on current project?
  2. Can I undo "bundle install" by using "bundle clean --force"? after doing this and running "bundle install" again it doesn't to make any changes (not showing "Installing" instead it's say "Using"
  3. I tried removing the the version of ruby since I found out that runing "bundle install" creates a directory /usr/share/rvm/gems/ruby-2.7.2@ruby_test_setup_engine/. But my issue was still there.

I also tried deleting the project folder and cloning it again but since /usr/share/rvm/gems/ruby-2.7.2@ruby_test_setup_engine/ was created it didn't do anything at all.


Solution

  • Not sure what kind of issues you are facing. but based on your question here is the details:

    1. Does "bundle install" saves the dependencies globally?
    1. Can I undo "bundle install" by using "bundle clean --force"?
    1. Removing gem directory won't help as it will create as soon as you run bundle install command.

    Another way to reset you gemset is remove your Gemfile.lock and copy from original source and re run bundle install.

    Hope this info will helps.