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.
Related
I need to install rvm on a new Ubuntu machine.
I would use rvm to switch to different ruby versions and gemsets required by different Ruby on Rails applications.
rvm suggests to use the Ubuntu package.
However Internet documentation on Rails on Ubuntu, such as at RailsApp, suggests to install rvm using instead the curl command with the --ruby or --rails options and the --autolibs=enable option for avoiding missing libraries:
$ \curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable
I could not find information specific to the --rails option, so I do not understand what it does, install only the rails gem or install rails plus other gems useful for the rails environment, like bundler and json for instance. There is a bug however: RVM does not install Rails when invoked with curl.
Considering that I do not need the rails gem in the global gemset, supposing that the above bug will soon be fixed, what is in the end the best choice for installing rvm in Ubuntu: the Ubuntu package or the curl command with the (hopefully explained) --rails option plus the --autolibs=enable option?
It depends on your Ubuntu Version.
lsb_release -a
Then you can search for the instructions based on your Ubuntu Release.
For example I am using Linux Mint based on Ubuntu Xenial 16.
Ubuntu uses the apt package manager to install packages
To find packages type in your terminal
apt search rvm
it will return a list of packages. To learn more about apt use:
apt --help
apt <command> --help
man apt
To install RVM you need to always reference their official webpage or github page
For ubuntu RVM has an official Ubuntu Page which give you the following instructions:
https://github.com/rvm/ubuntu_rvm
Follow those instructions
I want to install rvm and geting problem. Here is my command which i run in ubnto 2.10 How can i do this?
root#jaskaran-Vostro-1550:/home/jaskaran# rvm install 2.1.0
The program 'rvm' is currently not installed. You can install it by typing:
apt-get install ruby-rvm
root#jaskaran-Vostro-1550:/home/jaskaran# apt-get install ruby-rvm
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ruby-rvm
Use this instead to install RVM:
curl -sSL https://get.rvm.io | bash
You can refer to official RVM Installation Page.
Once RVM is successfully installed, make it available in the current shell:
source /etc/profile.d/rvm.sh
Then you can install the Ruby version you want:
rvm install 2.1.0 to install Ruby version 2.1.0.
You probably want to clean up your environment first just like this post tells you to: Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v
You can also do this:
sudo apt-get install rvm
next you will have to source the
source /home/username/.rvm/scripts/rvm
after then you can go ahead and install by running
rvm install version
Hope this help another person.
When I used "sudo apt-get install ruby-full build-essential" in the terminal I got this:
$ sudo apt-get install ruby-full build-essential
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/packages.medibuntu.org_dists_quantal_non-free_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
Can anybody tell me how can I install Ruby on Rails in my Linux Mint machine?
I think you don't need features of rvm. You just want to install ruby easy, fast and without troubles, right? Good news to you. We got an alternative to rvm. It's called rbenv. You can find an installation guide here.(don't skip ruby-build, it is necessary!).
And yes, follow ubuntu instructions since Mint is build on it (though there's debian-based version but I suppose you use ubuntu-based one).
I installed yesterday Mint 16 and rbenv on it. Works fine.
PS: don't forget to sudo apt-get install build-essential first.
I actually use Mint on my main development system. I'd also recommend using RVM to manage all your Ruby and Rails installation/versions. The command to install it is:
\curl -L https://get.rvm.io | bash -s stable
You can also append --ruby and --rails to get (I believe) the most recent versions of the two of them. I'd recommend not using apt-get for installing Ruby, as I've noticed that it can be out of date and/or lead to strange errors like those that you're seeing. You can get more information from the RVM website. I really enjoy using Mint, so I hope that helps.
Use rvm to install Ruby then simply install rails gem , but before that fix your repository related problem.
sudo rm -rf /var/log/apt/list
sudo apt-get update
sudo apt-get upgrade
Then install rvm see rvm.io for installation info
If you are new want to setup everything from start then see this blog post
https://www.computersnyou.com/4235
Use rbenv
instead, use this link DigitalOcean since mint is an ubuntu based distro, it will work.
I am new to Ruby and just diving in. The Ruby tutorial says I should get the packaging system from here: http://rubyforge.org/frs/?group_id=126
I am on Ubuntu Linux. The page has a .tar and a .gem option for downloading. Which should I download?
Also, are gems exactly analogous to Java jars? And why do I need the gem packaging system if I can just download gems one by one as they are needed?
Ubuntu now have rubygems as a package
For Ubuntu 12:
sudo apt-get install rubygems
For Ubuntu 14.04:
sudo apt-get install rubygems-integration
On Ubuntu 16.04 and Ubuntu 18.04, both sudo apt-get install rubygems and sudo apt-get install rubygems-integration failed for me. Instead, I had to do this:
sudo apt-get install ruby-dev
If on Ubuntu 14.04 try below
sudo apt-get install rubygems-integration
First, download *.tar file, unpack this file, then go to rubygems directory in your console, and type
ruby setup.rb
That's it :)
If you install the full ruby application set with
sudo apt-get install ruby-full
You will get gems and much more by default. Tested on Ubuntu 16, it could also work on other version.
For me in Ubuntu 20.04 I did 3 things to create a new Ruby and Rails app.
Install Ruby development version
sudo apt install ruby-dev
Install rails from gem
sudo gem install rails
Create new application
rails new blog
I got error while installing rails(sudo apt install rails) only, So I installed devlopment version. I got permission related error while not using Sudo as well while installing gems and rails.
For Ubuntu
First install ruby:
sudo apt install ruby
Note that : sudo snap install ruby will throw this error :
error: This revision of snap "ruby" was published using classic
confinement and
thus may perform arbitrary system changes outside of the security
sandbox that snaps are usually confined to, which may put your system at
risk.
If you understand and want to proceed repeat the command including
--classic.
Finally, download latest tar version of ruby gems here:
https://rubygems.org/pages/download
Unzip and cd to the folder and finally type in terminal:
sudo ruby setup.rb
is there any way to install Ruby 1.9.2 or 1.8.7 + Rails 3 on my debian squeeze?
You probably don't want to use RVM on a production machine. Its $PATH magic will break in non-obvious places (e.g. cron jobs), and you'll be up a creek.
You could simply build from sources and use checkinstall to create a .deb for yourself. Here's a tutorial for Ubuntu that should translate pretty well into debian.
First install rubygems, I think it's the only Debian package. Then (as Ruby gems):
rvm (install with it ruby 1.9.2, or Ruby version you want)
bundler
rails
And then you can manage application gems with Bundler.
Have you looked at railsready-debian-lenny (it is claimed to work on Squeeze too)? Don't forget to install dependencies pointed in readme.md
The steps below outlines installing Ruby On Rails as a normal user.
Check first if the user has sudo rights. To do this try executing a simple command
$sudo ls -a
[sudo] password for unlimit:
unlimit is not in the sudoers file. This incident will be reported.
If you see a message like above, you will need to add the user to the sudoer file, this can be done by
$echo 'unlimit ALL=(ALL) ALL' >> /etc/sudoers
Check if you have ruby installed. Execute the command below
$ruby -v
-[bash]: ruby:command not found
If you see something like this, this means ruby is not installed. Install it
$sudo apt-get install ruby
Install additional libraries
$sudo apt-get install build-essential
$sudo apt-get install curl
$sudo apt-get install libssl-dev
Install rvm
$curl -L get.rvm.io | bash -s stable
Set the rvm path
$source $HOME/.rvm/scripts/rvm
You should add this to the .bashrc file.
Fetch the latest rvm and reload it
$rvm get head && rvm reload
Install ruby 1.9.3
$rvm install 1.9.3 --with-openssl-dir=$HOME/.rvm.usr
I needed to install the readline lib
$sudo apt-get install libreadline-dev
Get the rails gem
$gem install rails -v 3.2.3
Check if you have rails
$rails -v
Rails 3.2.3
Get the readline package
$rvm pkg install readline
Get sqlite3
$sudo apt-get install sqlite3 libsqlite3-dev
You are all set to create your first rails app
$rails new app HelloWorld
You can find more info http://unlimit.in/installing-ruby-on-rails-on-debian.html
The best way to install Ruby and any Gems you like is with RVM. It will compile the latest version of Ruby for you and give you tools to manage gemsets.
Relying on the distribution's packages is usually a bad idea, because they are typically out-of-date.