rvm install fails searching for binary rubies on a vagrant box - ruby

I am trying to install rvm on a vagrant box Ubuntu 12.04. When I run the vagrant script the installation halts due to an error with this command:
curl -L https://get.rvm.io | sudo bash -s stable --ruby=$RUBY_VER --auto-dotfiles --verify-downloads 1
This is the output of that command running inside the vagrant script:
Turning on auto dotfiles mode.
Please read and follow further instructions.
Press ENTER to continue.
Downloading RVM from wayneeseguin branch stable
Upgrading the RVM installation in /usr/local/rvm/
source /etc/profile.d/rvm.sh
Upgrade of RVM in /usr/local/rvm/ is complete.
Upgrade Notes:
* No new notes to display.
# In case of problems:
# run and read: rvm notes
# read docs: http://rvm.io/
# talk to us: http://webchat.freenode.net/?channels=rvm
# read cheatsheet: http://cheat.errtheblog.com/s/rvm
# watch screencast: http://screencasts.org/episodes/how-to-use-rvm
# open a bug report: https://github.com/wayneeseguin/rvm/issues
# vagrant,
#
# Thank you for using RVM!
# I sincerely hope that RVM helps to make your life easier and more enjoyable!
!!
#
# ~Wayne
rvm 1.21.6 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <m
papis#gmail.com> [https://rvm.io/]
Searching for binary rubies, this might take some time.
.o binary rubies available for: ubuntu/12.04/i386/ruby-1.9.3-p374
Continuing with compilation. Please read 'rvm help mount' to get more informatio
n on binary rubies.
Installing requirements for ubuntu, might require sudo password.
Requirements installation successful.
, this may take a while depending on your cpu(s)...es/ruby-1.9.3-p374
, this may take a while depending on your connection...
.tar.bz2', it's not possible to validate it.ng.org/pub/ruby/1.9/ruby-1.9.3-p374
This could be because your RVM install's list of versions is out of date. You ma
y want to
update your list of rubies by running 'rvm get stable' and try again.
If that does not resolve the issue and you wish to continue with unverified down
load
add '--verify-downloads 1' after the command.
There has been an error fetching the ruby interpreter. Halting the installation.
However when I try to run the same instruction on the command line of the vagrant box it seems to work:
vagrant#precise32:~$ curl -sSL https://get.rvm.io | sudo bash -s stable --ruby=1.9.3-p374 --auto-dotfiles --verify-downloads 1
The output is this:
Turning on auto dotfiles mode.
Please read and follow further instructions.
Press ENTER to continue.
Downloading RVM from wayneeseguin branch stable
Upgrading the RVM installation in /usr/local/rvm/
Upgrade of RVM in /usr/local/rvm/ is complete.
Upgrade Notes:
* No new notes to display.
# In case of problems:
# run and read: rvm notes
# read docs: http://rvm.io/
# talk to us: http://webchat.freenode.net/?channels=rvm
# read cheatsheet: http://cheat.errtheblog.com/s/rvm
# watch screencast: http://screencasts.org/episodes/how-to-use-rvm
# open a bug report: https://github.com/wayneeseguin/rvm/issues
# vagrant,
#
# Thank you for using RVM!
# I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne
rvm 1.21.6 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
Already installed ruby-1.9.3-p374.
To reinstall use:
rvm reinstall 1.9.3-p374
Creating alias default for ruby-1.9.3-p374.
Recording alias default for ruby-1.9.3-p374.
Creating default links/files
Saving wrappers to '/usr/local/rvm/bin'........
* To start using RVM you need to run `source /usr/local/rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
Any ideas? I guess I could run manually the instructions on the vagrant files one by one but it would ruin the entire purpose of using provisioning. Thanks in advance.

Nevermind. It happened that my Git was configured to convert line ending from Linux to Windows format automatically, so when I downloaded the vagrant files they turned useless when Linux tried to extract Ruby version (and other stuff like that) from them.
So the solution in my case was to reinstall Git, setting "Configuring the line ending conversions" to "Checkout as-is, commit as-is":

Related

Trying to uninstall and fresh install Ruby on Ubuntu: do I still have Ruby installed?

I'm coming from Windows to Linux (Ubuntu) so I'm new to the CLI. I had issues trying to install Rails so I figured a fresh install would help. I'm following "Installing Ruby the Correct Way."
I thought I had uninstalled Ruby, but after installing 2.1.4 it still shows some Ruby folders. Have I completely uninstalled Ruby?
Downloading ruby-2.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/bf9952cdeb3a0c6a5a27745c9b4c0e5e264e92b669b2b08efb363f5156549204
Installing ruby-2.1.4...
Installed ruby-2.1.4 to /home/richard/.rbenv/versions/2.1.4
richard#richard-ThinkPad-T400:~$ rbenv global 2.1.4
richard#richard-ThinkPad-T400:~$ ruby -v
The program 'ruby' can be found in the following packages:
* ruby
* ruby1.8
Try: sudo apt-get install <selected package>
richard#richard-ThinkPad-T400:~$ sudo rbenv global 2.1.4
richard#richard-ThinkPad-T400:~$ ruby -v
The program 'ruby' can be found in the following packages:
* ruby
* ruby1.8
Try: sudo apt-get install <selected package>
Are the "the following packages" on my local system? or are they online?
EDIT
I've been getting this error when I try to install RVM (and some other applications):
GPG signature verification failed for '/home/richard/.rvm/archives/rvm-1.26.0.tgz' - 'https://github.com/wayneeseguin/rvm/releases/download/1.26.0/1.26.0.tar.gz.asc'!
try downloading the signatures:
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
they can be compared with:
https://rvm.io/mpapis.asc
https://keybase.io/mpapis
Does this have anything to do with it? I wouldn't really think so but I'm a noob.
Don't sudo rbenv anything or you will summon Cthulhu. Use rbenv by itself.
Also, don't randomly follow guides on the internet until you're more familiar with your OS; They go stale, or start out wrong, or don't accurately apply to what you're doing. Instead, go to the source and follow the directions there.
To find out what is installed on your machine, use locate to quickly find Ruby instances. Something like:
locate /bin/ruby | grep -v .rbenv
should narrow down whether multiple Rubies are installed outside the ~/.rbenv directory.
Traditionally, you'll find a normally installed system-wide Ruby in /usr/bin/ruby. A user installed one from source will probably be in /usr/local/bin/ruby unless you specifically said otherwise, probably with a PREFIX= directive.
rbenv will default to installing Ruby in the ~/.rbenv hierarchy since it acts like a sandbox manager and will put all Rubies it installs underneath that directory. RVM, a similar application, will use ~/.rvm, and in both cases, the purpose is to keep them where the user's permissions are sufficient to install and update gems without requiring the use of sudo. For general use, avoid sudo unless you understand what you're about to do, as it can turn a computer into an under-desk heater in seconds.
The shell uses the PATH variable to figure out where to look for executable commands. It sounds like your PATH isn't set correctly. If you followed the directions on the rbenv site, they say how to enable rbenv by modifying your ~/.bash_profile script. Doing that, then closing and reopening your shell should bring rbenv to life.
Following that blog post, you are installing Ruby using a tool called rbenv, and if you only uninstalled one Ruby, that doesn't mean that all Rubies are uninstalled.
The message that you posted shows that it is a local install: Installed ruby-2.1.4 to /home/richard/.rbenv/versions/2.1.4 which is a copy of the 4th line of your message.
You can find out from whence your Ruby executable is being invoked by issuing at the command line:
which ruby
You will then know if the program is available and which it is. Using ruby -v if it is there will tell you the version.
You have done some of these steps and are finding out that your system does not know how to get to the Ruby, if it is indeed installed.
Right now, it is effectively uninstalled, as it is unavailable to your environment.

"Warning! PATH is not properly set up" when using RVM with virtualenv

I am getting this error:
Warning! PATH is not properly set up, '/home/oscar/.rvm/gems/ruby-2.1.2/bin' is not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.1.2'.
rvm 1.25.28 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
when I go inside any virtualenv. It takes the virtualenv's path at first place. In this example I called my virtualenv borrar, so this is my PATH:
/home/oscar/projects/borrar/bin:/home/oscar/.rvm/gems/ruby-2.1.2/bin:/home/oscar/.rvm/gems/ruby-2.1.2#global/bin:/home/oscar/.rvm/rubies/ruby-2.1.2/bin:/home/oscar/eagle-6.6.0/bin:/home/oscar/android-studio/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/oscar/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-7-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
My path outside any virtualenv is which I assume is correct because rvm is at first place.:
/home/oscar/.rvm/gems/ruby-2.1.2/bin:/home/oscar/.rvm/gems/ruby-2.1.2#global/bin:/home/oscar/.rvm/rubies/ruby-2.1.2/bin:/home/oscar/eagle-6.6.0/bin:/home/oscar/android-studio/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-7-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/oscar/.rvm/bin
Here is my .zshrc
and here my .zsh_profile where I load RVM at the end.
I appreciate all your help.
RVM Path Mismatch
RVM is complaining because it wants to be first in your PATH. It isn't; you've prepended something else, or your virtualenv wrappers have. This being the case, you can either reinvoke the RVM setup script from inside your virtualenv with . ~/.rvm/scripts/rvm, or you can deliberately silence the error as described below.
The RVM documentation strongly recommends that the RVM setup script be the last thing you invoke in your shell resource files so that (among other things) RVM can be sure it takes precedence over other Rubies or wrappers that might be in your PATH. However, if you're sure that you know what you're doing and that you won't encounter any PATH-related surprises, you can turn off this warning by adding this little-known configuration option to your .rvmrc file:
echo 'rvm_silence_path_mismatch_check_flag=1' >> ~/.rvmrc

ERROR: Missing RVM environment file After Doing rvm upgrade command - Passenger 4.0.23

I was running ruby 2.0.0-p247 on my Mac Mini Server (Mavericks 10.9.1). I read that there was a security vulnerability so I decided to upgrade to use the latest Ruby patch 2.0.0-p353. I did the following commands:
gem update --system (RubyGems 2.1.11)
rvm get stable (RVM 1.25.0)
rvm upgrade 2.0.0-p247 2.0.0-p353 (which should have moved my gemsets)
There is nothing in my system that I can find that references 2.0.0-p247 in rvm which is what I expected. When I go to ~/myuser/.rvm/environments there is no file 2.0.0-p247.
I am now attempting to start passenger. I had version 4.0.23 enterprise installed. I attempted to run rvmsudo passenger-install-apache2-module but got an error.
cd /Users/myuser/.rvm/gems/ruby-2.0.0-p353#mygemset/gems/passenger-enterprise-server-4.0.23
/Users/myuser/.rvm/wrappers/ruby-2.0.0-p353# mygemset/rake apache2:clean apache2 RELEASE=yes
# /Users/myuser/.rvm/wrappers/ruby-2.0.0-p353# mygemset/rake apache2:clean apache2 RELEASE=yes
ERROR: Missing RVM environment file: '/Users/myuser/.rvm/environments/ruby-2.0.0-p247#LightBeCorp_Rails4Ruby2'
Here are statements in my .bashrc file related to rvm if this will help.
[[ -s "$HOME/.rvm/scripts/rvm" ]]
PATH="$PATH:$HOME/.rvm/gems/ruby-1.9.3-p327#mygemset/bin:/.rvm/rubies/ruby-1.9.3-p327/bin/ruby:/.rvm/rubies/ruby-1.9.3-p448/bin/ruby:/.rvm/rubies/ruby-2.0.0-p353/bin/ruby:/usr/bin/psql:/usr/local:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
I did a rvm list rubies command. ruby-2.0.0-p247 is not listed.
Any help would be appreciated. I will continue looking. I plan to post a link to this in the Phusion Passenger group.
UPDATE 12/21/2013 12:20 pm
I updated my .bashrc file to the following since I no longer use the other rubies in my Rails applications. I still get the error when I try to run rvmsudo passenger-install-apache2-module.
[[ -s "$HOME/.rvm/scripts/rvm" ]]
PATH="$PATH:$HOME/.rvm/rubies/ruby-2.0.0-p353/bin/ruby:/usr/bin/psql:/usr/local:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
looks like a bug, please open a ticket here: https://github.com/wayneeseguin/rvm/issues
Indeed this was a bug, to fix it run:
rvm get head
rvm gemset reset_env
you can repeat the reset_env operation for every gemset that is broken:
rvm ruby#gemset do rvm gemset reset_env
There might be a cached bin file in your RVM path. In my case, it's "/usr/local/rvm/bin/unicorn"
Also, you may not directly having the gem in your Gemfile. In my case, I do not have "unicorn" in my Gemfile although I had "capistrano-unicorn".
So that the system will try to use the global cached file "/usr/local/rvm/bin/unicorn".
The file's content may using a ruby that you no longer use.
if [[ -s "/usr/local/rvm/environments/ruby-2.0.0-p247" ]]
then
source "/usr/local/rvm/environments/ruby-2.0.0-p247"
exec unicorn "$#"
else
echo "ERROR: Missing RVM environment file: '/usr/local/rvm/environments/ruby-2.0.0-p247'" >&2
exit 1
fi

RVM install ruby from local source

I can't believe the this isn't a more frequently asked question.
I want to install ruby 1.9.2, and I want it as part of my RVM installation. The link for 1.9.2 has since 404'd on the ruby-lang site, so I copied the tar.gz from the ruby github page, rezipped it into a tar.bz2 like rvm requires and dropped it into ~/.rvm/archives
However, every time I call rvm install 1.9.2-p320 it deletes the source tar.bz2 from ~/.rvm/archives and tries to redownload the tar.bz2 from the ruby-lang site.
The --force and --disable-binary options do nothing to prevent the deleting and redownloading attempts.
Is there a way to point rvm explicitly to the source tar.bz2? I'd like to avoid compiling from source myself and then copying the directory into wherever rvm needs it.
Note: It looks like the ruby-lang ftp server is just down for the moment which explains why the download keeps failing, but my question still stands as this seems like good functionality for rvm to have.
The deletion of archive is controlled with --verify-downloads flag:
rvm install 1.9.2-p320 --verify-downloads 2 --disable-binary
Values for the --verify-downloads flag:
0 - has to have checksum and must validate
1 - does not have to have checksum, if available must validate
2 - continue even the checksum does not validate
The front page of ruby-lang.org does mention that some services would be down, I'd suggest waiting for them to get their services back up and trying again.
http://www.ruby-lang.org/en/news/2013/08/06/status-issue/
rvm usage clearly said
rvm [Flags] [Options] Action
The correct syntax for your problem is
rvm --verify-downloads 2 --disable-binary install 1.9.2-p320
rvm will check the flags and options first before executing any action

RVM Ruby Installation failed with no checksum [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am going crazy with this problem. I've installed rvm and re-installed a million times, but it just isn't working.
I have a fresh install of centOS 6.3 and when I go to install rvm, it completes, but then gives me a weird error when installing ruby. Here is the trace:
[pushprod#ruby-prod webapps]$ \curl -#L https://get.rvm.io | bash -s stable --autolibs=3 --ruby
######################################################################## 100.0%
Please read and follow further instructions.
Press ENTER to continue.
Downloading RVM from wayneeseguin branch stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1062k 100 1062k 0 0 609k 0 0:00:01 0:00:01 --:--:-- 1533k
Installing RVM to /home/pushprod/.rvm/
RVM PATH line found in /home/pushprod/.bashrc /home/pushprod/.zshrc.
RVM sourcing line found in /home/pushprod/.bash_profile /home/pushprod/.zprofile.
# RVM: Shell scripts enabling management of multiple ruby environments.
# RTFM: https://rvm.io/
# HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
# Cheatsheet: http://cheat.errtheblog.com/s/rvm
# Screencast: http://screencasts.org/episodes/how-to-use-rvm
# In case of any issues run 'rvm requirements' or read 'rvm notes'
Installation of RVM in /home/pushprod/.rvm/ is almost complete:
* To start using RVM you need to run `source /home/pushprod/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
# pushprod,
#
# Thank you for using RVM!
# I sincerely hope that RVM helps to make your life easier and
# more enjoyable!!!
#
# ~Wayne
rvm 1.20.9 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/6.4/x86_64/ruby-2.0.0-p195.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for centos, might require sudo password.
There is no checksum for 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6' or 'RPM-GPG-KEY-EPEL-6', it's not possible to validate it.
This could be because your RVM install's list of versions is out of date. You may want to
update your list of rubies by running 'rvm get stable' and try again.
If that does not resolve the issue and you wish to continue with unverified download
add '--verify-downloads 1' after the command.
There is no checksum for 'https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm' or 'epel-release-6-8.noarch.rpm', it's not possible to validate it.
This could be because your RVM install's list of versions is out of date. You may want to
update your list of rubies by running 'rvm get stable' and try again.
If that does not resolve the issue and you wish to continue with unverified download
add '--verify-downloads 1' after the command.
error: /home/pushprod/.rvm/archives/RPM-GPG-KEY-EPEL-6: import read failed(2).
error: open of /home/pushprod/.rvm/archives/epel-release-6-8.noarch.rpm failed: No such file or directory
Any ideas on what the problem might be? this is killing me!
Thanks in advance
I encountered the same issue. Try installing the EPEL RPM referenced in the error message;
error: open of /home/<username>/.rvm/archives/epel-release-6-8.noarch.rpm failed: No such file or directory
Download it from the following URL(also referenced in the rvm output):
https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
then enter;
rvm get stable
The above steps have seemed to get rvm running properly for me.

Resources