I am trying to install ruby on rails with this link
But getting error. When I ran this rvm install 2.3.1
I get this error
mkdir: cannot create directory ‘/usr/local/rvm/log/1467720951_ruby-2.3.1’: Permission denied
tee: /usr/local/rvm/log/1467720951_ruby-2.3.1/update_system.log: No such file or directory
Error running 'requirements_debian_update_system ruby-2.3.1',
showing last 15 lines of /usr/local/rvm/log/1467720651_ruby-2.3.1/update_system.log
tail: cannot open ‘/usr/local/rvm/log/1467720651_ruby-2.3.1/update_system.log’ for reading: No such file or directory
Requirements installation failed with status: 1.<br/>
When i ran curl -sSL https://get.rvm.io | bash -s stable <br/>
so it was install on /usr/local/rvm
When I ran ls when i was inside /usr/local/rvm getting this error
aniket#aniket.shivam-L740-X4010:/usr/local/rvm$ ls
archives config docs examples gems help installed.at LICENSE man patchsets RELEASE scripts tmp VERSION
bin contrib environments gem-cache gemsets hooks lib log patches README rubies src user wrappers
Please try with below command,
sudo chmod -R 777 /usr/local
then retry with
rvm install 2.3.1
Hope this will solve your problem.
Related
I am new using ruby. I am installing ruby on subsystem Linux.I follow the instruction in https://www.howtoforge.com/tutorial/ubuntu-ruby-on-rails/. And get error in download the RVM installer script and install the RVM. I got message
"mktemp: failed to create file via template ‘/usr/share/rvm/rvm-exec-test.XXXXXX’: Permission denied".
I change the command to
curl -sSL https://get.rvm.io | sudo bash -s stable --ruby
then I get error in the following step. It says "-bash: /usr/local/rvm/scripts/rvm: No such file or directory"
What can I do to fix this ?
Thank You :)
check /etc/profile.d/rvm.sh if this file was not removed by implode
Also make sure there is no simple
source /usr/local/rvm/scripts/rvm
in any of your shell initialization files?
grep -rn rvm ~/.bash*
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
I found a few posts regarding installing rvm, but none of them apply here. On a fresh VM installation on Koding, I've followed the instruction to install rvm
\curl -sSL https://get.rvm.io | bash -s stable
This seems to work fine, there are no errors downloading the 2 .tar.gz and .tar.gz.asc files
Then when i activate rvm using :
source ~/.rvm/scripts/rvm
that's when i get the error message "bash: /home/railspadawan/.rvm/scripts/rvm: No such file or directory".
I checked .rvm and the scripts directory is missing. I experienced the same problem on Nitrous.io, as well.
It wasn't working as the gpg signature verification had failed. I downloaded the signatures and voila! it works now.
rvm has started enforcing GPG signing and the problem surfaced some 3-4 days back (https://github.com/wayneeseguin/rvm/issues/3110). Looks like a necessary step from now for all new rvm installations.
1) gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
This installs GPG signatures. rvm has started enforcing GPG signing and the problem surfaced some 3-4 days back (https://github.com/wayneeseguin/rvm/issues/3110).
Steps 2 & 3 are unique to Nitrous.io and are a result of error messages during the rvm install.
2) unset GEM_HOME
3) added source ~/.profile to .bash_profile
followed by the rvm install steps
1) $ \curl -L https://get.rvm.io | bash -s stable
2) source /home/action/.rvm/scripts/rvm
cheers,
shalini
First I installed rvm for multi-user using script
\curl -L https://get.rvm.io | sudo bash -s stable
and I added users to rvm group.
and rvm seems worked fine. so I installed ruby 1.9.3 and set 1.9.3 as default
and now I tried to install rails with command
gem install rails
It seems worked fine, but when fetching json-1.7.6.gem and an error occurs.
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p374/bin/ruby extconf.rb
creating Makefile
make
sh: make: Permission denied
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p374/gems/json-1.7.6 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p374/gems/json-1.7.6/ext/json/ext/generator/gem_make.out
So I thought it would be related with permission, so I tried
sudo gem install rails
but then this error occurs.
sudo: gem: command not found
What should I do?
use sudo as follows..
sudo gem install rails
Updated Answer:
our $PATH variable needs to include the exact path to your Ruby's bin directory. Adding a directory to the PATH does not include it's subfolders. Try adding the bin directory via:
export PATH=$PATH:/home/adam/.gem/ruby/1.8/bin
or if you installed the gem using sudo:
export PATH=$PATH:/usr/lib/ruby/gems/1.8/bin
You might want to add this to your .bashrc file, so that you don't have to set this manually every time your open up a new bash.
you can use rvmsudo to run sudo commands. But you should really be using Gemfiles to install gems using Bundler.
I want to install ruby on my Linux Mint 12.
I am following this tutorial and this one.
when I run rvm install 1.9.3 I see this error:
Installing Ruby from source to: /usr/share/ruby-rvm/rubies/ruby-1.9.3, this may take a while depending on your cpu(s)...
ruby-1.9.3 - #fetching
ruby-1.9.3 - #extracting ruby-1.9.3- to /usr/share/ruby-rvm/src/ruby-1.9.3
ERROR: Error running 'bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_4428', please read /usr/share/ruby-rvm/log/ruby-1.9.3/extract.log
ERROR: There has been an error while trying to extract the source.
Halting the installation.
ERROR: There has been an error fetching the ruby interpreter. Halting the installation.
How to fix it?
EDIT: #ka8725
bunzip2 is installed. When i run cat /usr/share/ruby-rvm/log/ruby-1.9.3/extract.log
I see
[2012-02-25 01:11:55] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_32604
bunzip2: (stdin) is not a bzip2 file.
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
[2012-02-25 01:12:16] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_32740
bunzip2: (stdin) is not a bzip2 file.
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
[2012-02-25 01:13:50] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_383
bunzip2: (stdin) is not a bzip2 file.
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
[2012-02-25 01:13:52] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_474
bunzip2: (stdin) is not a bzip2 file.
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
[2012-02-25 01:13:58] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_568
bunzip2: (stdin) is not a bzip2 file.
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
[2012-02-25 01:18:57] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_4428
bunzip2: (stdin) is not a bzip2 file.
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
ANOTHER EDIT #EVERYONE :)
here whats happening guys:
rvm requirements outputs unrecognized error etc. However rvm notes will show me the needed stuff that i should install. BUT when i install these things, rvm will be removed
and so i have to reinstall lol!! :) once, twice, ten times, forever:) this what would happen
these are the packages that i need
sudo apt-get install build-essential bison 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
Uninstall and reinstall rvm with
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
For posterity, I'll add that the part of the error that says
Installing Ruby from source to: /usr/share/...
is what got me thinking about a broken installation of rvm which, as I said, is normally entirely contained in the ~/.rvm directory.
I solved my problem simply doing:
rvm get head
rvm reload
and rvm install 1.9.3
Doing an rvm update as suggested in one of the comments gave me some good errors on how to fix the problem. I purged apt-get ruby-rvm as suggested in the errors and installed with curl. Worked like a charm. Looking at the file name the apt-get version of rvm is grabbing it looks like the last part of the version is missing for some reason. Instead of ruby-1.9.3-.tar.bz2 it should be ruby-1.9.3-p327.tar.bz2 or something to that effect.
Here is what I did and what was suggested by the errors after rvm update:
sudo apt-get --purge remove ruby-rvm
sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh
open new terminal and validate environment is clean from old rvm settings:
env | GREP_OPTIONS= \grep rvm
install RVM:
curl -L https://get.rvm.io | bash -s stable
fix some more screwed up stuff from apt-get ruby-gem
make ~/.bash_profile look like this(it loads rvm as a function in bash):
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
update RVM:
rvm update
rvm reload
install ruby
rvm install 1.9.3
rvm use 1.9.3 --default
install current rubygems
rvm rubygems current
install rails
gem install rails
Done!
Issue solved, here's how in case you want to know:
As s.m. said, I uninstalled everything, then I opened another terminal session as a normal user and run:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
then i run source /home/my-desktop-username/.rvm/scripts/rvm as a normal user NOT ROOT
then i run rvm requirements as a normal user. Then I copy the requirements and close the session, open a root session and install the requirements using sudo
Then I close the session and open a normal user session and run rvm install ruby-1.9.3-p125 if you run this command as root, it will say that rvm is not installed and will suggest that you install it using sudo apt-get install rvm Don't do that!
So basically I had two problems, the tutorials that i followed didn't say that i should run
source /home/my-desktop-username/.rvm/scripts/rvm and didn't say that I should not run rvm as root, s.m told me that. Thanks to everyone, especially to s.m
Don't trust bloggers, Youtube users or forums. ONLY TRUST STACKOVERFLOW USERS!
If you cat /usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2 you will see
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.2.1</center>
</body>
So, rvm doesn't know where to find ruby-1.9.3 (it seems the path is mangled around '3-.tar')
And, 1.9.1 "compatibility" with 1.9.3 is a (not so funny) joke in Ubuntu.
The fix for me was:
rvm package install openssl
rvm install ruby-1.9.2 --with-openssl-dir=/usr/share/ruby-rvm/usr
As 1.9.2 happened matched all of my gem dependencies (e.g. nokogiri)
have you tried this answer Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v ?
it seams you use "apt-get broken rvm" make sure you follow the above answer.
I had the same problem with bunzip2.
A tail on ~/.rvm/log/ruby-1.9.3-p125/extract.log said:
bunzip2: (stdin) is not a bzip2 file.
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
It turns out that the downloaded file was the HTML homepage of rvm website instead of the archive itself.
So if like me all previous solutions didn't worked out. Check file type of your archive:
$ file ruby-1.9.3-p125.tar.bz2
ruby-1.9.3-p125.tar.bz2: HTML document, UTF-8 Unicode text, with very long lines
If you get something like this, just remove the archive and try to install it again.
For Ubuntu 18.10, I had the same error after installing via APT. rvm install 2.5.1 failed with the same error as referenced. After completing the instructions for Ubuntu on github and restarting my VPS, ruby v 2.6.3 installed using the command 'rvm install ruby' As I was on a vps, I had to run
source /etc/profile.d/rvm.sh first.
Github RVM Repo for Ubuntu
cat /usr/share/ruby-rvm/log/ruby-1.9.3/extract.log
It seems to me you don't have installed bunzip2. You should install it