bundler error and having issues to reinstall after delete RVM - ruby-on-rails

I deleted RVM, because I already had RBENV install. Now I cannot get bundler to work. This caused major issues. When I installed bundler again to run bundle i on my code, it gives me an error and it's looking for RVM.
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # dir_s_mkdir - /usr/local/rvm

Related

Permission denied # rb_sysopen gem install pg on Ubuntu 16.04

I have installed postgresql, libpq-dev and build-essential. When I ran gem install pg, I got a
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
I tried every solution I found in stackoverflow, but none of them worked. However, now I ran gem install pg, I got a new error
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - /home/woyuxuxu123/.rvm/gems/ruby-2.3.3/gems/pg-0.21.0/.gemtest
Could anyone help me on this? I have been stuck on this for a whole afternoon.
Use sudo before installing the gem or update in your system as like this:
sudo apt update
gem install pg

Unable to install pg gem on MAC

I have been trying to install pg gem using, gem install pg, and its showing me an error.
Then I tried brew install postgresql, which, in the end showed error stating use/local/bin already exixts. If I am directly running bundle install in the app folder, its showing the error on installing pg 0.18.4, stating permission denied # rb_sysopen.
The errors that I am getting:
Amans-MacBook-Air:~ aman$ gem install pg
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - /Users/aman/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/pg-0.18.4/.gemtest
Amans-MacBook-Air:~ aman$ brew install postgresql
Warning: postgresql-9.5.3 already installed, it's just not linked
Amans-MacBook-Air:~ aman$ brew link postgresql
Linking /usr/local/Cellar/postgresql/9.5.3... Error: File exists - /usr/local/lib
What should I do, any suggestions!

Permission Error When Trying To Install Rails (OSX)

I am new to programming and am trying to get rails installed on my terminal. I have been following instructions from a friend, installing the xcode command line tools, homebrew, git, rbenv, ruby-build, ruby gems, ruby, and postgres. But whenever, I try $gem install rails, I get the following:
Russell-Silvers-MacBook-Pro:~ Russell_Silver$ gem install rails
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - /Users/Russell_Silver/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rails-4.2.0/README.md
This is especially frustrating because when I run $gem list, it says I have rails 3.2.18. Which is peculiar, because when I run $rails v$, it tells me I have Rails 4.2.0.
When I try to use rails rails my new_app
Errno::EACCES: Permission denied # rb_sysopen - /Users/Russell_Silver/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rails-4.2.0/README.md
An error occurred while installing rails (4.2.0), and Bundler cannot continue.
Make sure that `gem install rails -v '4.2.0'` succeeds before bundling.
run bundle exec spring binstub --all
/Users/Russell_Silver/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/shared_helpers.rb:83: warning: Insecure world writable dir /Users/Russell_Silver in PATH, mode 040707
bundler: command not found: spring
Install missing gem executables with `bundle install`
Russell-Silvers-MacBook-Pro:~ Russell_Silver$ bundle install
/Users/Russell_Silver/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/vendor/thor/shell/basic.rb:355: warning: Insecure world writable dir /Users/Russell_Silver in PATH, mode 040707
Could not locate Gemfile or .bundle/ directory
This is really frustrating, especially for someone new to programming such as myself, so I am seeking help from anybody who might know what is wrong.
Your rbenv installation was incorrectly installed as it had elevated privileges which caused your user account to not have write access to ~/.rbenv.
Issue the following command in order to take of ownership of the directory:
sudo chown -R Russell_Silver ~/.rbenv
Note that some users may have a different rbenv directory, e.g. /usr/local/var/rbenv. This would take the place of ~/.rbenv in the above command.

error instatlling ruby on rails in mac

I was trying to install ruby on rails in mac.
I have Xcode and gcc compiler installed. When i tried to install git, it showed me the following error:
$:~ gem install git
$ ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Library/Ruby/Gems/1.8/gems/git-1.2.5
I changed the permissions of my 1.8 and gems directory. Still it is showing the same error. Any suggestions?
Have you tried with sudo? Try sudo gem install git.
Reference documentation: https://github.com/schacon/ruby-git#install

ERROR: While executing gem ... (Errno::EISDIR) gem install rails

I'm trying to install Ruby on rails, so first I installed RVM rvm install 1.9.2. After that install this gem install rails. It shows this error
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /var/lib/gems/1.8 directory.
Then I used this sudo chmod 0777 /var/lib/gems/1.8/
After that when I install, its showing this error:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /var/lib/gems/1.8/cache/railties-3.2.2.gem
Then I run sudo chmod 0777 /var/lib/gems/1.8/cache/railties-3.2.2.gem
After that I install gem install rails. Again its showing this error
ERROR: While executing gem ... (Errno::EISDIR)
Is a directory - /var/lib/gems/1.8/cache/railties-3.2.2.gem
You're still using the system ruby install (1.8). To use the Ruby you've just installed with rvm, do rvm use 1.9.2. Then try gem install rails again. The Rails gem should be installed under your home directory, you shouldn't need root permissions.
To make the rvm Ruby the default, so you always start with it when you open a new terminal, do rvm --default use 1.9.2 (note that's two dashes).
manually install gem-ctags, then retry installing your failing gem
gem install gem-ctags
gem install backports -v '3.3.3'
bundle install

Resources