I got this error on using RVM
kithokit#14:22:59 ~ $ rvm install 1.9.3
mkdir: cannot create directory ‘/usr/local/rvm/log/ruby-1.9.3-p448’: Permission denied
Could not detect ruby version/name for installation, please be more specific.
How can i change the default directory to /home/kithokit/.rvm
You can remove all the trace by executing this script
#!/bin/bash
/usr/bin/sudo rm -rf $HOME/.rvm $HOME/.rvmrc /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm /usr/local/bin/rvm
/usr/bin/sudo /usr/sbin/groupdel rvm
/bin/echo "RVM is removed. Please check all .bashrc|.bash_profile|.profile|.zshrc for RVM source lines and delete
or comment out if this was a Per-User installation."
coming from https://rvm.io/support/troubleshooting#sudo
make sure to restart machine to get rid of any environment variables that would point out to the old location (yes it is required in case of playing with system installation).
Related
Installing RVM with command below gets installed to ${HOME}/.rvm. Instead, I'm looking for a way to specify the location where .rvm directory gets created so that I can control where RVM is installed.
curl -sSL https://get.rvm.io | bash
Is there a way to specify this while installing RVM?
Yes, by creating a symlink from ~/.rvm to $TARGET_DIR and before installing rvm. In this example I am using a directory called 'myrvm':
ln -sf myrvm/ ~/.rvm
Then when I check the contents of 'myrvm', I see rvm is installed there. RVM still works seemlessly
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -e:70: warning: Insecure world writable dir /usr in PATH, mode 040777 It appears Homebrew is already installed. If your intent is to reinstall you should do the following before running this installer again: rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
I have this on my terminal but I cant make use of homebrew. I need to use homebrew to install django pyhton web framework. However I don't seem to get the error here. It says its already installed but none of the brew commands work.
ghochee-macbook-pro:logs streamoid$ brew doctor -bash: brew: command not found <<<<<
Can anyone please help? I also see that there is no .bash_profile file with the PATH variable set, am I looking the right folder and file here?
It sounds like /usr/local/bin isn't on your $PATH. You can add it by running the following command in the terminal:
echo 'export PATH="/usr/local/bin:${PATH}"' >> ~/.bash_profile
Then restart your terminal for the changes to take affect.
I recently created a Linode server with Ubuntu 12.04 LTS
as the admin user aurelien I installed rbenv (in my case 1.9.3-p194 for my older rails 3.2 app).
Afterwhich I ran gem install passenger and was placed in the directory ~/.rbenv/shims
After that I ran rbenv rehash
and to install nginx:
I couldn't run passenger-install-nginx-module because it asked to use with sudo. When I tried sudo passenger-install-nginx-module it told me command not found.
Then I found this post PhilT's answer
and tried running sudo bash -c "source ~/.bashrc && passenger-install-nginx-module"
/home/aurelien/.rbenv/shims/passenger-install-nginx-module
I went through the entire passenger/nginx installation and pressed "enter" when it asked for the prefix directory.
in my root directory cd ~/home/aurelien and I can't find /opt/nginx.
Did it correctly create these directories?
The only directories/files I have on the root are these:
. .. apps .bash_history .bash_logout .bashrc .cache .gem .gitconfig .profile .rbenv .ssh .viminfo
EDIT: My .bashrc file
export RBENV_ROOT="${HOME}/.rbenv"
if [ -d "${RBENV_ROOT}" ]; then
export PATH="${RBENV_ROOT}/bin:${PATH}"
eval "$(rbenv init -)"
fi
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
The answer posted before by PhilT had the correct code for installing nginx together with passenger:
gem install passenger
rbenv rehash
sudo bash -c "source ~/.bashrc && passenger-install-nginx-module"
The fault in your explanation above is that /opt/nginx is not in user's home directory (~/home/aurelien/opt/nginx), but in the root directory (plainly /opt/nginx.), as nginx is a system-wide install.
(Note: In some other systems nginx also has config files placed in /etc/nginx instead)
Question is very simple:
I cannot install RVM (single-user installation), as if I follow the instructions on the RVM website, that is:
$ curl -L https://get.rvm.io | bash -s stable
I get a permission denied error at line 360 of the installation script file (the line that starts with echo):
# Perform the actual installation, first we obtain the source using whichever
# means was specified, if any. Defaults to head.
case "${version}" in
(head)
echo "${branch}" > "$rvm_path/RELEASE"
install_head ${branch:-master} || exit $?
;;
Here is the error message:
olivier#~$ curl -L https://get.rvm.io | bash -s stable
bash: line 360: /usr/local/rvm/RELEASE: Permission denied
If I add "sudo" before "bash" in the command above, it works fine, but it is then the multi-user install ...
Indeed, I solved this by uninstalling old versions of RVM: sudo rvm implode and then deleting the file /etc/rvmrc. Once done, I could install the single-user version and everything worked fine!
Sorry Remear, I wanted to edit your answer or complete it via my comment but I could not (comment can only be edited within 5 minutes...at least I upvoted...).
Once you have a system-wide install, you can't run a single-user install as it will detect your system-wide install first and try to update it.
But it is possible to have a root install & then user install by specifying the installation path :
curl -sSL https://get.rvm.io | bash -s stable --path $HOME/.rvm
You will also have to set the single-user install path in your user path manually as RVM does not create it when you already have a system-wide install (not really an intended use) :
# .bashrc
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
And also load your user rvm :
# .bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Are you setting rvm_path in ~/.rvmrc, or in /etc/rvmrc, or in one of your bash scripts? I'd recommend removing both of those files as well as ~/.rvm and then try installing rvm again WITHOUT sudo.
this work for me, first uninstall all versions and then as user (NO root) follow the next commands:
For example, I'm using Ruby 2.6.3 and Rails 5.2.2 and setting up helping a little in these web pages:
https://gorails.com/setup/ubuntu/20.04
https://rvm.io/rvm/install
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
$ curl -sSL https://get.rvm.io | bash -s stable --ignore-dotfiles
$ source ~/.rvm/scripts/rvm
$ rvm install 2.6.3
$ rvm use 2.6.3 --default
$ ruby -v
$ gem install rails -v 5.2.2
$ rails -v
Check the paths:
$ which -a gem
$ which -a ruby
Now you can Add some gems (inside you app directory):
$ gem install faker
All works great for me, hope this helps!
I am planning to create an installer for a ruby script but I want to be able to ensure that the machine has RVM installed. Is there a way to install RVM completely offline and unobtrusive as well(by unobtrusive, as in create a script that can do everything instead of ask users to add something to their bash_profile or bashrc)
I am not asking for the script itself, just a quick pointer as to how to go about this route(if it is even possible). We have also looked into this question which was helpful enough:
RVM - is there a way for simple offline install?
but a bit misleading as the answer only shows us how to install a ruby in RVM offline. We need to be able to install RVM itself offline, and looking at the script
https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer
do I just include this whole script and change the rvm_releases_url into something else? And is it safe to just append the rvm path to a user's bash_profile, or bashrc instead of asking them to do it?
As per the suggestion given editing this comment. :-)
Installing RVM offline :
- Download the rvm tarball:
curl -sSL https://github.com/rvm/rvm/tarball/stable -o rvm-stable.tar.gz
- Create and enter rvm directory:
mkdir rvm && cd rvm
- Unpack the tar file :
tar --strip-components=1 -xzf ../rvm-stable.tar.gz
- Install rvm:
./install --auto-dotfiles
use --help to get the options
- Load rvm:
source ~/.rvm/scripts/rvm
Download Ruby, rubygems and yaml :
- Download ruby
o Find tar.bz2 version at:
https://ftp.ruby-lang.org/pub/ruby/ (check sub-directories)
o Download with curl: :
curl -sSL https://ftp.ruby-lang.org/pub/ruby/ruby-2.2.0.tar.bz2 -o ruby-2.2.0.tar.bz2
o Make sure you are downloading with the extension " .tar.bz2 "
- Download rubygems
o Find version at:
https://github.com/rubygems/rubygems/tags
o Download with curl:
curl -sSL http://production.cf.rubygems.org/rubygems/rubygems-2.4.6.tgz -o rubygems-2.4.6.tgz
Install dependencies :
- Disable automatic dependencies ("requirements") fetching using the following command.
rvm autolibs read-fail
- Manually download and install dependencies
o Get the list of dependencies using
rvm requirements
Installing Ruby :
Clean default gems:
echo "" > ~/.rvm/gemsets/default.gems
Clean global gems:
echo "" > ~/.rvm/gemsets/global.gems
Install Ruby:
rvm install 2.2.0 --rubygems 2.4.6 (this may require sudo password for autolibs)
Install any other Ruby versions you want similarly
Set default Ruby version: rvm use 2.2.0 --default
NOTE : The ruby and other packages should be placed in the " $rvm_path/archives/ " directory.
Installing gems :
There are multiple ways to install gems, we can download the gem files,
but the best way seems to be Bundler: http://bundler.io/bundle_package.html
Example installing rails gem:
Offline
--------
Create a directory:
mkdir gems; cd gems
Unpack gems:
tar xzf gems.tgz
Install bundler:
gem install bundler-1.8.3.gem
[ This needs internet, to avoid internet connection you need to install bundler gem using --local option with the bundler.x.x.gem file ]
Install gems:
bundle install --local
UNINSTALL rvm :
rvm implode --force
Then remove rvm from following locations:
rm -rf /usr/local/rvm
sudo rm /etc/profile.d/rvm.sh
sudo rm /etc/rvmrc
sudo rm ~/.rvmrc
Check the following files and remove or comment out references to rvm
~/.bashrc
~/.bash_profile
~/.profile
~/.zshrc
~/.zlogin
Comment-out / Remove the following lines from /etc/profile
source /etc/profile.d/sm.sh
source /etc/profile.d/rvm.sh
/etc/profile is a readonly file so use
sudo vim /etc/profile
You can find the installation method here also...
Reference : https://github.com/rvm/rvm-site/blob/master/content/rvm/offline.md
Update: Finally finally finally!!! We have it!
https://rvm.io/rvm/offline/
Full instructions for offline installation!
It should be enough to get copy of the sources and run:
./install
in the root of it,
for installing ruby you will need to get archives of ruby and rubygems to rvm/archives and set rubygems_version=1.8.24 in rvm/user/db
There is also another project I'm involved that will embed RVM and allow offline installation: https://github.com/railsinstaller/railsinstaller-nix