error when run rvm requirements - ruby-on-rails

I followed
this tutorial
to install rvm on ubuntu 12.04
when run rvm requirements, I got the following message
Installing requirements for ubuntu, might require sudo password.
Running 'apt-get --quiet --yes update' would require sudo.
Cowardly refusing to continue, please read 'rvm autolibs'.
Updating repositories
Missing required packages: libgdbm-dev, libffi-dev.
Cowardly refusing to continue, please read 'rvm autolibs'.
I got same message when run rvm install 1.9.3
Can anyone help?
Thanks.

Sometimes the official documentation it's more reliable than a blog. Take a look at the rvm documentation. The command from the blog to install rvm is:
curl -L get.rvm.io | bash -s stable
and the official documentation recommend that one:
\curl -L https://get.rvm.io | bash -s stable --autolibs=3 --rails
Probably this will solve your problems with autolibs, the same that was happening for example in that question .

from https://rvm.io/rvm/autolibs - there are two modes that will be useful for you:
rvm autolibs read-only - it will do all the steps and only show the required commands / missing libraries
rvm autolibs enable - it will install everything for you, it might require sudo password so a nice trick for tools like capistranos is to:
rvm autolibs read-only
sudo rvm --autolibs=enabled requirements ruby-2.0.0
rvm install ruby-2.0.0
A writeup about autolibs https://blog.engineyard.com/2013/rvm-ruby-2-0

I was getting some sort of same error:
Missing required packages: libreadline6, libreadline6-dev, libyaml-dev, libffi-dev.
Cowardly refusing to continue, please read 'rvm autolibs'.
Even though Ubuntu Software Center showing "libreadline6, libreadline6-dev etc" installed.
I got this fixed disabling autolibs:
rvm autolibs disable
ruby install 1.9.X worked!

Below solution is to solve the rvm requirment error returns 100
If any deb command is commented in /etc/apt/sources.list than try to uncomment that command from /etc/apt/sources.list
Command is:
$sudo vi /etc/apt/sources.list
If problem is not solved than replace sources.list file with other Ubuntu's sources.list
Command is:
$mv <file path of sources.list from other Ubuntu machine> /etc/apt/sources.list
Please make a backup before doing that
Command is:
$cp /etc/apt/sources.list sources_backup.list
Problem should solve by this time, if not than reinstall the Ubuntu.
Note: If sources.list file is corrupted than it will gives problem to install other packages.

Related

bash: /home/XXX/.rvm/scripts/rvm: No such file or directory

I just walk-through with the installation of Ruby on Rails on Ubuntu using RVM.
First I have logged in as the root user.
Then I started with the following commands.
\curl -sSL https://get.rvm.io | bash -s stable --rails
It has been installed without any error.
source ~/.rvm/scripts/rvm
When I run this command. It showing the error as bash: /home/XXX/.rvm/scripts/rvm: No such file or directory
I added the [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" command in my .bashr file.
Install RVM:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
Now you will get a success message. Then, run this command:
\curl -sSL https://get.rvm.io | bash -s stable
See http://rvm.io/ for more info.
I think they may have moved some files around fixed with:
source /usr/share/rvm/scripts/rvm
After installing rvm, try:
source ~/.rvm/scripts/rvm
If the above command throws some issue, try this command:
source /usr/local/rvm/scripts/rvm
Firstly no need to go for sudo access while installing rvm, just follow the very basic commands below
$\curl -sSL https://get.rvm.io | bash -s stable
This will install rvm.
$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p374]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p320]
[ruby-]1.9.3[-p545]
[ruby-]2.0.0-p353
Install a version of ruby as required.
$ rvm install 2.0.0-p353
Now you can use the version of ruby for which you need to install rails as a gem.
$ rvm use 2.0.0
Also you can make it default if you want so
$ rvm use 2.0 --default
Next you can install rails as a gem.
$ gem install rails
gems should never be installed with sudo access as they change from project to project. rvm helps in managing the different versions of ruby in one m/c. You can also use gemsets to isolate gems and specific versions from one application to another.
just create ~/.rvm/scripts/rvm directories, then try to install rvm but make sure you are not logged in as root.
This source /usr/share/rvm/scripts/rvm works for me on ubuntu 20.04.
I changed the local in /usr/local/rvm/scripts/rvm to share
I assume that you have installed the rvm.
Is generally not recommend to install RVM as a root user because of umask security risk. Try running these commands as a user.
Downloading RVM (Do not sudo this command)
\curl -sSL https://get.rvm.io | bash -s stable --rails
Then you'll need to add the location to sources(You'll probably need to reload your bash for rvm to work)
source ~/.rvm/scripts/rvm
You can install your desired version like so(replace ruby_version with one you would like to install, eg 2.1.4)
rvm install ruby_version
To list the available version on your machine
rvm list
To use a version of ruby run
rvm use ruby_version
If you have any trouble refere to the RVM website
As root, you traditionally don't have a /home folder. Root's home is different than a normal user.
You very likely don't want to install RVM as root.
Please do read the information at http://rvm.io specifically the installation notes.
Can you use sudo find to locate the correct path of the rvm directory? If you find the path, you should be able to rerun the source ~/.rvm/scripts/rvm command with the correct path.
Also, I fully agree with the previous answers about not creating it as root. DigitalOcean was a pretty good tutorial on adding users https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04
Alright so when you get a failure message "No such file or directory",
type
\curl -L https://get.rvm.io | bash -s stable
in your terminal.
There will be a GPG signature verification failure.
Bellow that failure there would be a link for github and a key something like this
gpg2 --recv-keys 409B6B...
So download a tar file from the github link and run this code to install GPG:
sudo apt install gnupg2
and run that key :
gpg2 --recv-keys 409B6B...
next run the code:
\curl -L https://get.rvm.io | bash -s stable
it will show you installing the rvm
and then you can run:
source ~/.rvm/scripts/rvm
thats it you are good to go
If you install rvm via apt-get you can add the following line into ~/.zshrc or ~/.bashrc
source /etc/profile.d/rvm.sh
For me all the above methods didn't workout.
After the installation and updates, still the terminal shows this "error bash: /root/.rvm/scripts/rvm: No such file or directory"
The simple method which helps me to solve this error is :
Show Hidden Files
Go to the Home (where the bash scripts are stored)
Edit the .bashrc
At the bottom you can find some lines about rvm
just clear the rvm lines and save the file.
Open terminal and check it.
Your surest bet is to use home brew. Funny part is if you try brew upgrade ruby, you will have an error if brew wasn't used to install ruby in the first instance so use:
$ brew install ruby
Then afterwards use
$ brew upgrade ruby
You may need to close and reopen your terminal to see the effect of the upgrade by typing
$ ruby -v

ruby install rvm not working

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.

Installing Ruby on Rails on Linux mint?

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.

Can't install Ruby on Rails with RVM on Ubuntu 13.04

I am trying to install RVM on my Ubuntu machine.
I have used curl to get RVM, but some RVM commands (install, requirements) throw this apt-get error:
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
type rvm | head -1 returns
rvm is a function
-bash: type: write error: Broken pipe
which gem
/usr/bin/gem
I have checked the "Run command as a login shell" option
Steps followed from this tutorial:
sudo apt-get install curl
curl -L get.rvm.io | bash -s stable --auto
. ~/.bash_profile
rvm requirements - doesn't work properly
I have also looked at the official RVM documentation, but it seems to be very similar.
Any ideas?
UPDATE: I managed to do it. I disabled all the third party ppa URLs and it installed smoothly.
There are some important packages your system needs before install rvm. Run at the terminal:
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 nodejs
Then install rvm with:
curl -L https://get.rvm.io | bash -s stable --ruby
Now you need to put a setting in your .bashrc to add rvm to PATH for scripting. Run:
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
Open a new terminal and test rvm.
run
sudo apt-get update
sudo apt-get install build-essential
and then try again.
Hye Guys!!
I got the solution. Actually error is because the information we need for installation is not available at sever define for software & update. I change it to from my local "Server from India" (In my case) to "Main Server".
It's working perfectly for me now :)
I was having the same problem with my install, and then I fully read the details that terminal left once the install was finished.
Try using source /usr/local/rvm/scripts/rvm
Once I did that, the function type rvm | head -1 returned rvm is a function
In my Case i fixed the error by:
rvmsudo rvm install 1.9.3
rvm --default 1.9.3
rvmsudo rvm remove 1.9.3
rvm install 1.9.3
Source
Try disabling repository which appear at 404 sudo apt-get update or viewing logs rvm. The fact is that when you install rvm is trying to update a list of your packages and if you have 404 to go to bed =)
\curl -L https://get.rvm.io | bash -s stable --ruby .
paste this in your terminal window.I used this.It worked for me.for RVM for ruby
\curl -L https://get.rvm.io | bash -s stable --rails .
Use these to install RVM with ruby on rails
For people that know nothing about Linux or are newbies to Linux (like me) those are steps how to solve this (explanation, that was given above, was not that clear for me :) ).
Go to Package Manager, tab Settings, Preferences
In the opened window you'll see Other Software tab or something like that with links to servers. In my case one of these (it's mentioned in the error log that was produced by rvm) was causing errors and was not available (404 errors). I just unchecked it.
run rmv dependencies only when you closed Package Manager, or you'll get error saying that something is locked at the moment.
And everything now is installed successfully! :)
The most common symptom of this problem occurs (as seth2810 hinted at) with non-zero exit codes from an apt-get update command, which rvm requirements expects. You should run this command yourself (with sudo) and check for any problems.
If you have 404s in the output, check that the package sources for the bad URLs are still correct/current. You can remove package sources more easily with sudo apt-get install software-properties-common, followed by sudo add-apt-repository --remove {URL_OF_PROBLEM_PACKAGE_SOURCE} for each failed url.
If you have something hinting at packages with 'unmet dependencies', try sudo apt-get -f install. This command attempts to fix incomplete installs by fetching missing packages and works most of the time. Otherwise... by this point you probably have a more specific error to google for anyway!

Install RoR on debian Squeeze

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.

Resources