Abdul Ahmad
Abdul Ahmad

Reputation: 10021

rails `bundle install` trying to install system wide

I accidentally ran sudo bundle install and now when I run just bundle install I get an error:

Error details:

Errno::EACCES: Permission denied @ rb_sysopen -

here are the environment/bundler settings:

Environment
      
  Bundler   1.12.3
  Rubygems  2.6.4
  Ruby      2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin14]
  GEM_HOME  /Users/abdulahmad/.rvm/gems/ruby-2.3.0
  GEM_PATH  /Users/abdulahmad/.rvm/gems/ruby-2.3.0:/Users/abdulahmad/.rvm/gems/ruby-2.3.0@global
  RVM       1.27.0 (latest)
  Git       2.5.4 (Apple Git-61)
  rubygems-bundler (1.4.4)
      
      Bundler settings
      
  orig_path
    Set via BUNDLE_ORIG_PATH: "/Users/abdulahmad/.rvm/gems/ruby-2.3.0/bin:/Users/abdulahmad/.rvm/gems/ruby-2.3.0@global/bin:/Users/abdulahmad/.rvm/rubies/ruby-2.3.0/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/abdulahmad/.rvm/bin"
  orig_gem_path
    Set via BUNDLE_ORIG_GEM_PATH: "/Users/abdulahmad/.rvm/gems/ruby-2.3.0:/Users/abdulahmad/.rvm/gems/ruby-2.3.0@global"

is it trying to install system gems rather than just for my rails app? how can I fix this?

Upvotes: 2

Views: 949

Answers (1)

Nirupa
Nirupa

Reputation: 787

Update the global rubygems with :

sudo gem update --system --no-user-install.

Or try this:

bundle install --path ~/.gem

Other option is just uninstall bundler and install it again.

Upvotes: 1

Related Questions