Error on installing ruby with RVM
It is bug in rvm, see latest commit https://github.com/wayneeseguin/rvm/commit/52018750763d5321b7b993e201c8589b98e090f9
/usr/local/rvm/bin/rvm-shell: No such file or directory
set :default_shell, "/bin/bash -l"
works for me
Problem deploying Ruby+RVM and daemontools
I found the answer but looking at the rvmsudo script installed with rvm, here is a working run script:
#!/bin/sh
# redirect stderr to stdout
exec 2>&1
cd /app
# load rvm
. /usr/local/rvm/scripts/rvm
# select ruby version for this application
rvm use 1.9.1
# # depending on your configuration you may need to provide the absolute path to rvm, like that:
# /usr/local/bin/rvm use 1.9.1
# build the exec command line preserving the rvm environment
command="exec sudo -u app_user /usr/bin/env PATH='$PATH'"
[[ -n "${GEM_HOME:-}" ]] && command="${command} GEM_HOME='$GEM_HOME' "
[[ -n "${GEM_PATH:-}" ]] && command="${command} GEM_PATH='$GEM_PATH' "
# this is where your real command line goes
command="${command} ruby main.rb"
# run the application
eval "${command}"
RVM not found, after installing RVM
If there's no scripts
directory inside .rvm
, it would seem that RVM failed to successfully complete installation. Delete the .rvm
directory, try reinstalling, and look at the installation output closely to see if it's complaining about anything.
Problem installing RVM
Ack, I didn't mean to post this as a comment on the question. Anyway, if I had to guess, I'd say you installed rvm using sudo or as root. If that is the case, remove it and reinstall without sudo:
sudo rm -rf $HOME/.rvm $HOME/.rvmrc /etc/rvmrc /etc/profile.d/rvm.sh \
/usr/local/rvm /usr/local/bin/rvm
sudo /usr/sbin/groupdel rvm # this might fail, it's not that important
Open new terminal window/tab and make sure rvm is removed:
env | grep rvm
The output should be empty, sometimes it's needed to relogin, after it's empty you can continue:
curl -sSL https://get.rvm.io | bash -s stable
It works perfectly fine installed for the local user.
rvm installation not working: RVM is not a function
You are not using an login shell.
The process of enabling the login flag is described here, also some details on what a login shell is can be found here.
Thus, you need to check the option "Run as login shell" in the Gnome terminal's settings. It is required to open new terminal after this setting the flag.
Sometimes it is required to set the command to /bin/bash --login
.
For remote connections it is important to understand the differene between running interactive ssh
session and executing single commands.
While running ssh server
and then working with the server interactively you are using login shell by default and it's all fine, but for ssh server "command"
you are not using login shell and it would be required to run it with ssh server 'bash -lc "command"'
.
Any remote invocation can have the same problem as executing single command with ssh
.
ruby in linux: permanently source .rvm/scripts/rvm?
You need to add your
source .rvm/scripts/rvm
into your $HOME/.bashrc
file; read the advanced bash scripting guide for more.
Related Topics
How to Make a Ruby Script Run Once a Second
Rails - Paperclip Validating Attachment Size When It Shouldn't Be
How to Create a Symbol from a String That Has Whitespaces
Dynamically Create Index with Mongoid
Delete Non-Utf Characters from a String in Ruby
How to Access the Base Namespace in Ruby
How to Calculate 32 Bit Crc in Ruby on Rails
Capistrano 3 + Sprockets 3 + Rails 4.2.1 Won't Deploy
How to Get Generators Call Other Generators in Rails 3
Pretty Print to a File in Ruby
Rails Custom Validation - Only One Record Can Be True
How to Color Unit Tests with Lib Minitest or Test:Unit
Ruby - Remove Pattern from String