I accidentally ran sudo bundle install smtp_mail
and now all my gems are in this directory called smtp_mail
inside my Rails app.
I'm not sure about the default location of gems? And, my Rails app is complaining when it starts. Is there a way I can revert back?
Select Tools | Bundler | Install from the main menu. Open the Gemfile, place the caret at any highlighted gem missing in the project SDK and press Alt+Enter . Select Install missing gems using 'bundler' and press Enter .
bundle install is a command we use to install the dependencies specified in your Gemfile.
The path is specified in a file located in
.bundle/config
If you delete the .bundle directory and then delete your smtp_mail directory you will be back at square one. If you really want a local (to your app) installation of the gems, I recommend you run
bundle install --path vendor/bundle
Good luck!
After a bit of Googling around i was able to find the answer Just run:
sudo bundle install --system
and you'll have your gems back at their appropriate system directories.
pay attention on this...
from the bundle man page:
By default, bundler installs gems to the same location as gem install.
You should never use sudo bundle install. This is because several other steps in bundle install must be performed as the current user:
- Updating your Gemfile.lock
- Updating your vendor/cache, if necessary
- Checking out private git repositories using your user's SSH keys
Of these three, the first two could theoretically be performed by chowning the resulting files to $SUDO_USER. The third, however, can only be performed by actually invoking the git command as the current user. Therefore, git gems are downloaded and installed into ~/.bundle rather than $GEM_HOME or $BUNDLE_PATH.
As a result, you should run bundle install as the current user, and bundler will ask for your password if it is needed to put the gems into their final location.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With