RVM Ruby on Rails installation - ruby-on-rails

I'm having a trouble installing rvm ROR on my machine using ubuntu 12.04
here are the outputs I'm getting:
Output #1:
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/12.04/i386/ruby-1.8.7-p371.Continuing with compilation.
Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for ubuntu, might require sudo password.
and at the end of the line of update I get this:
Output #2:
There has been error while updating 'apt-get', please give it some time and try again later.
For 404 errors check your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list

Try running sudo apt-get update separately on a command line. Your Ubuntu might be old and its repositories could be out of date. So apt-get update itself is maybe not working in your machine.
To step over that issue, run the following commands:
# Disable RVM from trying to install necessary software via apt-get
rvm autolibs disable
# Then try installing Ruby:
rvm install 1.8.7
If you still face errors, see if you can directly do apt-get install without doing apt-get update (which fails):
# Try to see if you can manually install the necessary software
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
If that's also not working, then paste your apt-get update output.

Related

I have run command rvm intall and get error

I want to install rvm, but I get this error. How do I remove this error?
root#jaskaran:/# ruby -v
The program 'ruby' can be found in the following packages:
* ruby1.8
* ruby1.9.1
Try: apt-get install <selected package>
//--------------------------------------------------------------
here#jaskaran:/$ rvm install 2.1.0
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/12.10/i386/ruby-2.1.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system................
Error running 'requirements_debian_update_system ruby-2.1.0',
showing last 15 lines of /home/zapbuild/.rvm/log/1396242152_ruby-2.1.0/update_system.log
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'There has been error while updating '\''apt-get'\'', please give it some time and try again later.
For 404 errors check your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
\n'
There has been error while updating 'apt-get', please give it some time and try again later.
For 404 errors check your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
++ return 100
Requirements installation failed with status: 100.
Thanks
To install rvm run this.
$ \curl -sSL https://get.rvm.io | bash
Or in case you just want to update your rvm with the available ruby list, use rvm get stable. Now install ruby using rvm install ruby-2.1.0 or rvm install 2.1.0. This should fix the issue
I ran into the same issue on ubuntu 14.04 today.And I removed broken source in source.list and source.list.d/*.And it just worked fine for me.
After that you can run
sudo apt-get update
rvm requirements
Hope that is helpful.
Remove PPA sources from software setting and run these commands in your terminal:
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.3
rvm use 2.1.3 --default
ruby -v
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
gem install rails
rails -v

Error While installing Ruby

I have used this procedure.I m using Linux Mint.
I am getting the following error while installing.
E: Unable to locate package libreadline6-dev
E: Unable to locate package libyaml-dev
E: Unable to locate package libgdbm-dev
E: Package 'ncurses-dev' has no installation candidate
E: Package 'bison' has no installation candidate
E: Package 'subversion' has no installation candidate
E: Package 'libffi-dev' has no installation candidate
I think you didn't installed the rvm requirements .
Install the requirements like libreadline6-dev , libyaml-dev , libgdbm-dev ,etc..
I think This will solve the Problem.
Install all these with the command
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev \
curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 \
libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison \
subversion pkg-config
Or, Just refer this link.
This instructions are old, following rvm installation instructions:
\curl -#L https://get.rvm.io | bash -s stable --autolibs=4 --ruby
It will:
Download and install RVM
Enable automatic requirements installation
Install ruby including all required dependencies
which OS you using ?
if you using Ubuntu,
then use the link :
http://blog.sudobits.com/2012/05/02/how-to-install-ruby-on-rails-in-ubuntu-12-04-lts/
if you are using windows
then problem while installing in some gem dependence like. 'libffi-dev', less-rail
than used other OS that very well for "Ruby on Rails" like Linux/Ubuntu
If you're using ubuntu, the copy and paste https://github.com/vaneyckt/Ruby-on-Rails-installation-script/blob/master/install.sh. You might need to hit enter at some point.
this worked for me.
WARNING: The following packages cannot be authenticated!
apt-get clean # Remove cached packages
cd /var/lib/apt
mv lists lists.old # Backup mirror info
mkdir -p lists/partial # Recreate directory structure
apt-get clean
apt-get update # Fetch mirror info

ruby 2.0 rails gem install error "cannot load such file -- openssl"

I am using osx 10.8.2 installed ruby 2.0 and....
got this when trying to run "sudo gem install rails"
$ sudo gem install rails
ERROR: Loading command: install (LoadError)
cannot load such file -- openssl
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
I had ruby 1.9.x and rails 3.2.x working alright before
You have to install OpenSSL first and recompile ruby again:
RVM:
rvm pkg install openssl
rvm reinstall ruby-2.0.0-p0 --with-gcc=gcc-4.7 --with-openssl-dir=$rvm_path/usr
If you're using RVM please follow:
$ brew install automake
$ rvm pkg install openssl
$ rvm requirements run
$ rvm reinstall all --force
$ gem install rails
It worked for me.
I had very bad time with this ERROR.
Finally i done with it. There is only Once solution either you are with RVM or without RVM.
Make sure you have installed OpenSSL first BEFORE installing ruby.
RVM
Uninstall rvm
rvm implode
or
rm -rf ~/.rvm
Don’t forget to remove the script calls in your .bashrc and/or .bash_profile (or whatever shell you’re using).
sudo apt-get install zlib1g zlib1g-dev build-essential openssl libssl-dev libmysqlclient18 libmysqlclient-dev libyaml-dev curl git-core python-software-properties libpq-dev nodejs
Then install RVM, post ruby.
OR
rvm pkg install openssl
rvm reinstall ruby-2.0.0-p0 --with-gcc=gcc-4.7 --with-openssl-dir=$rvm_path/usr
WITHOUT RVM
First you should find where Ruby is:
whereis ruby
will list all the places where it exists on your system, then you can remove all them explicitly. Or you can use something like this:
rm -rf /usr/local/lib/ruby
rm -rf /usr/lib/ruby
rm -f /usr/local/bin/ruby
rm -f /usr/bin/ruby
rm -f /usr/local/bin/irb
rm -f /usr/bin/irb
rm -f /usr/local/bin/gem
rm -f /usr/bin/gem
THEN
sudo apt-get install zlib1g zlib1g-dev build-essential openssl libssl-dev libmysqlclient18 libmysqlclient-dev libyaml-dev curl git-core python-software-properties libpq-dev nodejs
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
tar -xvzf ruby-2.0.0-p247.tar.gz
cd ruby-2.0.0-p247/
./configure --prefix=/usr/local
make
make install
I hope this help you.
I fix this error for ruby 2.1.2 as follow.
rvm pkg install openssl
rvm reinstall ruby-2.1.2 --with-openssl-dir=$rvm_path/usr
On OSX, with rbenv and homebrew, the following worked for me:
brew install openssl
CONFIGURE_OPTS=--with-openssl-dir=$(brew --prefix openssl) rbenv install whatever-ruby-version
This worked for me which is similar to some of the other answers already posted.
rvm pkg install openssl
rvm reinstall all --force
When installing ruby 2.0, it is possible that rubygems 2.0 installation did not complete ok, because of openssl.
Make sure you provide a valid path to the openssl config file; you could:
find . -type f -name "openssl.cnf"
path is usually $HOME/.rvm/usr or $HOME/.rvm/usr/ssl
Then
[sudo] rvm reinstall ruby-2.0.0-p0 --with-openssl-dir=[openssl.cnf path] --verify-downloads 1
Make sure rubygems installation complete successfully.
Might be a better way to fix that path without reinstalling, but this should do it.
Make sure to check out this page on the rvm site: https://rvm.io/packages/openssl/
Running
rvm requirements run
gave me:
Missing required packages: autoconf, automake, libtool, pkg-config, apple-gcc42, readline, libxml2, libxslt, libksba, openssl, sqlite
after brew install autoconf automake ...
I was able to rvm reinstall 2.0.0 without openssl errors
I had the same problem with the same OS version. I use rvm and followed the steps in this command:
$ rvm requirements
Following those instructions, I ran:
$ brew update
$ brew tap homebrew/dupes
$ brew install bash curl git
$ brew install autoconf automake apple-gcc42 libtool pkg-config openssl readline libyaml sqlite libxml2 libxslt libksba
I had the same problem earlier, tried all of the snippets about and none of them worked out. After looking around for a bit the following worked for me:
$ rvm remove 2.0.0 # get rid of unsuccessful installation
$ rvm get head --autolibs=3 # get the latest RVM and build required libs
$ rvm requirements # just in case, install all other required stuff
$ rvm install ruby-2.0.0
$ rvm --default use ruby-2.0.0
What does rvm get head --autolibs=3 do exactly? I'm guess it automatically downloads dependencies, but I was hoping for a clear answer.
I encountered the same openssl error on Fedora when trying to use gem install <package>. It seems you need to install additional packages with yum/dnf
sudo dnf install rubygems rubygem-bundler ruby-devel mariadb-devel
After running the above command, gem install <package> should now work.
just went through the same problem. Takes a bit time but, upgrading openssl with
brew upgrade openssl#1.1
worked for me. Version might be different in the future, type brew install openssl to see which version you can upgrade to. I hope it helps.
If you have libssl1.1, your problem may be that these older versions of ruby (2.4 is the cutoff) are only compatible with libssl1.0.
For debian/ubuntu, please ensure that apt-get install libssl1.0-dev succeeds.
If you are using ruby-install, it will take the same openssl argument as rvm:
ruby-install ruby-2.0.0-p247 -- --with-openssl-dir=/usr/local/opt/openssl

What are the dependencies given on "rvm requirements" useful for?

Why does RVM, Ruby or Rails need libc6-dev, ncurses-dev and libtool ?
on Ubuntu running rvm requirements gives us:
Requirements for Linux ( DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10" )
NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
This is the original / standard Ruby Language Interpreter
'ree' represents Ruby Enterprise Edition
'rbx' represents Rubinius
bash >= 4.1 required
curl is required
git is required (>= 1.7 for ruby-head)
patch is required (for 1.8 rubies and some ruby-head's).
To install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head), then you
must install and use rvm 1.8.7 first.
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: /usr/bin/apt-get install build-essential openssl libreadline6
libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev
libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf
libc6-dev ncurses-dev automake libtool bison subversion pkg-config
# For JRuby, install the following:
jruby: /usr/bin/apt-get install curl g++ openjdk-6-jre-headless
jruby-head: /usr/bin/apt-get install ant openjdk-6-jdk
# For IronRuby, install the following:
ironruby: /usr/bin/apt-get install curl mono-2.0-devel
Why does RVM, Ruby or Rails need libc6-dev, ncurses-dev and libtool ?
For the other packages, as far as i can make out:
build-essential automake bison autoconf pkg-config is useful for compiling from source
libreadline6 libreadline6-dev is needed for irb's readline support
openssl libssl-dev is required for ruby's SSL support
curl git-core subversion is required for fetching software
zlib1g zlib1g-dev is required for unpacking rubygems
libyaml-dev is required for ruby's YAML support
libsqlite3-dev sqlite3 is required for sqlite support for rails
libxml2-dev libxslt-dev is required for parsing XML via nokogiri
Want to know why RVM added them in the first place?
What well known libraries will break if any of these packages are not installed?
Which of these packages are necessary for ruby itself to be installed and which of them are needed for a stdlib ie. yaml or rexml ?
EDIT: forgot pkg-config
EDIT: added some more questions at the end
ruby comes with a set of extensions, some of them require additional packages, for example ncurses is needed for better console support (irb) - but is not required, pkg-config is needed for packages searching - most packages expose a configuration file which helps in finding proper paths for compilation ... and so on, here is list of all extensions: https://github.com/ruby/ruby/tree/trunk/ext ... although it's not the list of requirements - i can not find official ruby list of requirements.
libc6-dev are the C standard library development files. It's very unlikely that any useful C code would compile without them. As Ruby is written in C, those are needed to compile and build ruby itself.
I would guess that ncurses is needed to compile irb.
I would agree with the purpose of the other packages you mention.
These are all basic libraries which are dependencies for various gems you will use in future.
build-essential openssl libreadline6
libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev
libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev
autoconf libc6-dev ncurses-dev automake libtool bison subversion
There may be a case like you will not require all the libraries in you m/c, though when you will install some gems, errors like
cannot build native extension
In those cases the required libraries are looked upon for the failed gem and installed. Libraries are installed only once and are totally different as compared to gems. The libraries present here are for
Git, mysql server, sqlite, curl etc.
I would suggest to install it in the beginning with sudo permissions using Sudo apt-get install. Hope this helps. Also as you try out new gems and plugins, you would be installing new libraries in future.

How do I install Ruby with libyaml on Ubuntu 11.10?

I installed ruby-1.9.3-p0 on my Ubuntu 11.10 wubi and then rubygems to get Rails set up.
This is my code:
sudo ruby setup.rb
I got this error:
"/usr/local/lib/ruby/1.9.1/yaml.rb:56:in'<top(required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby."
I installed libyaml and reinstalled Ruby but still it doesn't work.
The information changed and I have no idea what's wrong with it.
You must install the paquage libyaml-dev before installing ruby, if not you can still use extconf.rb for the missing library. So for this problem you can do (from the ruby install folder) :
cd ext/psych
ruby extconf.rb
make
make install
Extconf.rb is usefull for adding a library after have installed ruby.
Do the following:
you must have "curl" installed :sudo apt-get install curl
Go To this link RVM
Copy the command in the quick install box and Paste it in your command prompt
Type echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
Type ~/.bashrc
Type the following code:
sudo apt-get install build-essential libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
Type: rvm install 1.9.3-p0
Type: rvm use 1.9.3-p0
Type: gem install rails
Have fun :)
Ok, after a failed attempt at installing RoR on my Ubuntu 11.10 box, I combined the tips from this page and from this resource: http://www.thegeekwork.com/how-to-install-ruby-on-rails-in-ubuntu-11-10/
This is the breakdown, step-by-step of what I just did to make this work (sorry if I didn't format this so great, I was just trying to keep it neat):
1) Fresh install of Ubuntu 11.10
2) me#Box:~$ sudo apt-get install curl
3) me#Box:~$ sudo apt-get install git
4) me#Box:~$ sudo apt-get update
5) me#Box:~$ sudo apt-get dist-update
6) me#Box:~$ sudo shutdown -r now
7) me#Box:~$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
8) me#Box:~$ gedit ~/.bashrc
9) add the following line to the end (and save the file)
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
10) me#Box:~$ source ~/.bashrc
11) me#Box:~$ type rvm | head -1
After executing above command you should be getting this output -
rvm is a function
You’ve successfully installed the RVM. Next, you are supposed to install additional dependencies. To find out those programs type -
12) me#Box:~$ rvm requirements
After the above command, install the additional packages recommended by RVM -
13) me#Box:~$ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
14) me#Box:~$ rvm install 1.9.2
(#14 takes a little while)
15) me#Box:~$ rvm use 1.9.2
(This selects the version you want to use)
(If you aren’t sure about the ruby version currently being used, then type -
ruby -v)
16) me#Box:~$ gem install rails
(this will take a little while...)
17) Make a sample application as a test...
me#Box:~$ rails new test_app
me#Box:~$ cd test_app
me#Box:~/test_app$ rails server
AND THAT"S WHERE THIS THING DIDN"T WORK. ARRRRRRRRRrrrrrrrrrrrrrgh.
So,
18) in your application folder ("test_app"), open Gemfile and uncomment "therubyracer" line
19) me#Box:~/test_app$ bundle install
20) me#Box:~/test_app$ rails server
Done, and done.
I don't understand why it set 0.0.0.0:3000 as the host address (I thought it would be 127.0.0.1), but quite frankly, that's not bothering me right now -- I got it to work (so far). Time to get going with some Rails! :D
I hope this helps anyone else who is looking to make this work! :)
Note: I realize that #13 repeats some of the things I already installed, but I don't care, I'm just doing what the thing says. :/
Note2: Holy learning curve on just posting an answer! I wasn't sure what was considered "code" and apparently the prompt is considered code. Makes sense now :)
Note3: This is my first "Answer" on StackOverflow! :D
If you are compiling ruby you might need libyaml-dev
Debian (and Ubuntu, etc.) packages that contain the files needed to install some other program from source usually end in -dev, e.g. libyaml-dev, so try installing that. Or just use rvm, it will actually install this for you.
Compling yaml from its source will make it work. I am running the same config as yours. I followed this http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/. It definitely works.

Resources