rvm install 1.9.2 Permission denied - ruby-on-rails

Installing RVM on Ubuntu 11.04.
Followed the instructions here: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you
When it comes time to install Ruby, I get a permission denied exception.
kevinwmerritt#ubuntu:~$ rvm install 1.8.7
bash: /home/kevinwmerritt/.rvm/scripts/manage: Permission denied
The .rvm folder appears in my home directory and the bash scripts initialize rvm successfully.
Using sudo yields the following:
sudo rvm install 1.8.7
sudo: rvm: command not found
I am new to Ubuntu.

If you did a single-user install of RVM do not use:
sudo rvm install 1.8.7
RVM creates its own sandbox in ~/.rvm which does not need root privileges ever. At NO time do you need to use sudo before rvm. sudo will only screw up everything.
Use an unadorned rvm install 1.8.7 or rvm install 1.9.2 or any other version of Ruby known to RVM. You can see the list it knows about using rvm list.

I am running into the same exact problem. I compared it against another installation of rvm on a different box that is working and noticed the permission for "manage" is different.
The box that is working:
-rwxr-xr-x 1 deployer deployer 59002 2011-05-19 22:56 manage
The box that is not working:
-rw-r--r-- 1 deployer deployer 59076 2011-05-22 22:12 manage
I did a chmod 755 manage and that seems to have fixed it. I installed rvm the same way on both boxes, not sure why there's a difference.
You can try
chmod 755 /home/kevinwmerritt/.rvm/scripts/manage and see if that resolves it

Related

How to uninstall RVM in Ubuntu 18.04 completely?

I tried uninstalling rvm in Ubuntu LTS 18.04 using the following command:
rvm implode
After uninstalling, I tried installing it again using the following command:
sudo apt-get install rvm
But re-installation was unsuccessful and when I run rvm I get the following:
rvm: command not found
What are the steps to correctly remove rvm?
After the command rvm implode you should run gem uninstall rvm to make sure there's nothing left in your Ruby system install pointing to your rvm folder.
Usually, in order to remove what you have, sudo apt-get remove rvm should suffice, else try adding the --purge flag like in sudo apt-get remove rvm --purge. I understand you wanted to use the built-in command though. I don't know where you found the instructions you have followed, but it's weird that they didn't insist on the next step (uninstalling the gem).
For reinstalling, RVM has a dedicated Ubuntu package.
My advice is to do what I did to install it on my work computer, which was running Ubuntu. It's all listed here, but to take you through it:
Add the offical repository, update and install
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm
You'll have a group 'rvm' among your user groups. Add your user to it
sudo usermod -a -G rvm <yourusername>
In the link I included you'll find the instructions to have your terminal (assuming you're using Gnome as your Desktop Environment) login every time you reboot, enable local gems, install and change versions of Ruby and more.
According to the official information it souldn't work with just apt-get.
Visit this page and follow the steps.

How to install rbenv, Ruby, gems and Rails as root user

I installed rbenv, Ruby, gems and Rails as the root user, so I cannot run Ruby as a normal user.
When I try using bundle install, it returns:
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
I tried to run it as a normal user, but rbenv, Ruby, gems and Rails are not working.
How can I make them available to normal users?
I am using Ubuntu 14.04, and followed "Groom your app’s Ruby environment with rbenv." to install.
Uninstall rbenv, you may need to use sudo or to start a shell as root that means run the command sudo su. Then run exit to go back to normal user.
Then install rbenv again as normal user. Ubuntu 14.04 is no longer supported so if you can upgrade to 16.04 you may follow this tutorial or if you have to use ubuntu 14.04 install following this tutorial (as normal user).

Upgrade rails version permission denied rvm folder /bin/rails

I try to install rails 3.2.20 with ruby2.2.0.
So with rvm I make
rvm install 2.2.0
After I make
gem install rails -v 3.2.20
After rvm use default ruby-2.2.2
But when I try rails -v, I have the error
-bash: /home/xxx/.rvm/gems/ruby-2.2.0/bin/rails: Permission denied
Why? I try also chmod -R 777 on .rvm but nothing change
If I try
which ruby I have
/usr/local/rvm/rubies/ruby-2.2.0/bin/ruby
If I try whch rails I have nothing
check if you are logged in as the correct user
check if the permissions of the user’s home directory are correct, e.g. /home/xxx/
remove the ruby under /usr/local/bin
reinstall rvm if all fails

ruby/rails setup on ubuntu

I created a new VM using virtualbox and ubuntu 14. I then installed rvm using the following...
\curl -sSL https://get.rvm.io | bash -s stable --ruby
I'm still quite new to ubuntu/linux so I'm trying to get a handle on the terminal commands. So, I think that I first did a
sudo su -
thinking that this would allow me to specify my password once and then remember it for each command. But now I'm thinking that it instead changed me to the root account instead of my own? The reason I suspect this is because when I first open a terminal under my account and type in ruby -v, I get..
The program 'ruby' can be found in the following packages:
* ruby
* ruby 1.8
Try: sudo apt-get install <selected package>
If I then do a sudo su - and follow it with ruby -v, I get
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
So, I'm not sure if I've done something wrong with the rvm installation or if there's some way to get my own account to use the same version of ruby as root? Thanks.
From the comments, you seem to have installed RVM as root. Doing that will make RVM and its rubies only "visible" to the root user. (Actually installing RVM for any user only makes it visible to that specific user AFAIK).
To fix that, first remove the root RVM installation, run sudo su - to become root (if you aren't already - to check what user you are you can run whoami). Then run the following:
rvm implode
This removes RVM altogether.
Next exit to become a normal user (again, check with whoami, if you're stuck just open a new terminal window) and run the RVM installation command:
\curl -sSL https://get.rvm.io | bash -s stable --ruby
This should get you out of your problem.

executable ruby1.8 missing

So I was trying to install redmine on an apache2 server on Ubuntu.
Between multiple atemps to install a plugin, I "accidentaly" deleted /usr/bin/ruby1.8.
Now I get this error when I try to launch redmine with ruby2.0 (even after a rvm install 1.8) :
*** ERROR ***: Cannot execute /usr/bin/ruby1.8: No such file or directory (2)
What should I do to have this executable back ?
Thanks for your help
I suspect ruby1.8 was the already installed system ruby; can check with dpkg --get-selections | grep ruby . If this is the case, I would uninstall ruby 1.8 from rvm and then reinstall the system ruby through apt.
Once that's been cleared up, and you have a /usr/bin/ruby1.8 again, check/manage your available rubies through rvm:
rvm list
rvm use <ruby version>
etc.

Resources