How to use RVM in CSH environment? - rvm

I have installed RVM using following procedure (https://rvm.io/rvm/install)
curl -sSL https://get.rvm.io | bash -s stable --ruby --rails - it has installed RVM (single-user) in $HOME. (Question: How do I specify a non-default RVM installation path in above command?)
Updated $PATH in my ~/.cshrc to have RVM bin path as below. set path = ($HOME/.rvm/bin ${path})
prompt>which rvm
$HOME/.rvm/bin/rvm
prompt>rvm -v
rvm 1.26.9 (latest) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
prompt>rvm list
rvm rubies
# No rvm rubies installed yet. Try 'rvm help install'.
Though I have used --ruby and --rails in step (1), I noticed that Ruby & Rails were not installed as part of (1). So trying to install Ruby myself, using rvm install ruby
Per RVM installation instruction, I need to source $HOME/.rvm/scripts/rvm, which uses bash to execute. But our entire environment has tcsh as shell, and I cannot afford to change it.
prompt>source ~/.rvm/scripts/rvm
if: Too few arguments.
It is erroring out since our default shell is TCSH and the script is written in BASH.
prompt> echo $SHELL
/bin/tcsh
And we use ~/.cshrc to configure our environment.
Can someone help me to fix the setup, so that I can use RVM?
Thanks in advance.
I tried following options:
Using this as workaround now: How do I use RVM with tcsh? (it doesn't work good when I try running rvm use to switch Ruby Version.
prompt>rvm use 1.8.6-p383
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for an example.
http://po-ru.com/diary/using-rvm-with-tcsh/ does not help
RVM is not a function, selecting rubies with 'rvm use ...' will not work is not a solution for my problem. I verified it is not working.
Unfortunately, we are not using ~/.bashrc or ~/.zshrc environments? Does it mean RVM is not supporting CSH/TCSH environments?
Thanks for all your help in advance.

Related

RVM - Automatically use a certain Ruby version for a given command?

I have some commands that need particular version of Ruby e.g. Chef's knife command seems to work best with 2.0.0 while sup works best with 1.9.2. Is there a way, without writing a wrapper script or manually do "rvm use", that when I execute "sup" it will use 1.9.2 and when I execute knife it will use "2.0.0"?
I realise this question is not strictly "development" but there are lots of RVM questions on SO already so I figured it was a good place to ask.
rvm generates wrappers for you:
rvm wrapper 2.0.0 --no-prefix knife
rvm wrapper 1.9.2 --no-prefix sup
assuming you do not install this gems in all rubies the default from $rvm_path/bin/ will be used with loading proper ruby.

install ruby on Rails in mac 10.6.8

Hi every one I try to install the last version on ruby on rails and I have several problem when run this command
\curl -L https://get.rvm.io | bash -s stable --ruby
The version of my mac is 10.6.8
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.6/i386/ruby-2.0.0-p0.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Skipping `brew update` make sure your formulas are up to date.
RVM autolibs is now configured with mode '2' => 'check and stop if missing',
please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
or visit https://rvm.io/rvm/autolibs for more information.
Missing required packages: autoconf, automake, libtool, pkg-config, libyaml, readline, libxslt, libksba, openssl, sqlite.
RVM autolibs is now configured with mode '2' => 'check and stop if missing',
please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
or visit https://rvm.io/rvm/autolibs for more information.
There were package installation errors, make sure to read the log.
Check Homebrew requirements https://github.com/mxcl/homebrew/wiki/Installation
On OSX 10.6 instead of command line tools install:
https://github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.6.pkg
download this application and install it, and run again the line to install ruby, but I obtain the same error.
Any idea!
This was a known issue with rvm (see: https://github.com/wayneeseguin/rvm/issues/1671).
The issue was resolved. Install rvm separately from ruby, then try
rvm install 2.0.0 --autolibs=4
to install 2.0.0.

Passenger on Apache 2 Installation fails with Your RVM wrapper scripts are too old

I'm trying to install passenger on a virtual rootserver (which has multiple user accounts) but running 'passenger-install-apache2-module' results always in the following error:
Your RVM wrapper scripts are too old. Please update them first by running 'rvm get head && rvm reload && rvm repair all'.
Following this given instructions does not take any effect.
Before installing passenger, i installed RVM as multiuser / mixed mode according to https://rvm.io//rvm/install/
After that I did (using a non root-account):
rvmsudo rvm user gemsets
rvm install 1.9.3
gem install rails
gem install passenger
and lastly passenger-install-apache2-module
I searched for hours on this problem but could not find any working solution yet.
Any suggestions ? Thanks in advance!
Try to install passenger-install-apache2-module like this :
rvmsudo passenger-install-apache2-module
I just encountered this very same issue. I'm using ZSH, but switching to Bash also failed on first attempt.
My solution was to switch to Bash with the --login flag:
/bin/bash --login
Then I noticed that my RVM ruby had become unset, so I re-set using:
rvm use ruby-1.9.3 --default
Once this was done, the following worked as expected:
passenger-install-apache2-module
Rich
I have had similar issue and have taken extreme steps on my centos 6.3 system after struggling for days! In specific, I failed to install standalone phusion passenger apache2 module on gemsets other than default and global. I have taken the following steps and now, it works for me:
Login as root (I hope you know what you're dealing with)
To completely uninstall existing rvm, invoke
[root#] rvm implode
Install stable rvm, invoke
[root#] curl -L get.rvm.io | bash -s stable
run rvm shell,
[root#] source /etc/profile.d/rvm.sh
check rvm requirements, invoke
[root#] rvm requirements
and install all requirements.
Install ruby 1.9.3, invoke
[root#] rvm install 1.9.3
Install current rubygems, invoke
rvm rubygems current
Set default to ruby 1.9.3, invoke
[root#] rvm use 1.9.3 --default
Add other users who are using rvm to rvm group, invoke
[root#] usermod -a -G rvm USERNAME
If USERNAME is currently logged in, pls logout so the group add will take effect.
Make sure rvm group added, invoke
[USERNAME#] groups
Create and Switch to a new gemset on ruby 1.9.3, invoke
[USERNAME#] rvm use 1.9.3#mygemset --create
Confirm that you're on the right gemset, invoke
[USERNAME#] rvm gemset name
Install passenger gem, invoke
gem install passenger
To skip gem documentation instead, invoke
[USERNAME#] gem install passenger --no-ri --no-rdoc
or specify them in your .gemrc file
To install apache2 mod, invoke
[USERNAME#] passenger-install-apache2-module
Hope that helps!

How do I install same version of ruby as different names with rvm?

After I installed a version of ruby with rvm, I noticed that some minor configuration issue on installation process. So I wanted to try to install with another configuration options, but I don't want to spoil the installed ruby at all.
So I just to attempt to backup the installed ruby before rvm reinstall.
(cd .rvm/rubies && mv ruby-1.9.3-p194 ruby-1.9.3-p194.org)
In my case, reinstallation fixed the issue, I didn't rollback ruby. So, I don't know this can work.
Are there any clean or correct way? Just for future references.
you can install named rubies:
rvm install 1.9.3-test1 [options]
and after it worked set it as default:
rvm use 1.9.3-test1 --default
or reinstall the original 1.9.3, named rubies are useful especially for testing compilation flags or patched rubies:
rvm install 1.9.3-performance --patch falcon
You can also have different gemsets with the same version using
rvm create gemset projectname

Need help setting up passenger with RVM

I'm trying to setup passenger with rvm. I keep getting this error
Your RVM wrapper scripts are too old.
Please update them first by running
'rvm update --head && rvm reload &&
rvm repair all'.
I did that still same problem
GNU C++ compiler... found at /usr/bin/g++
Curl development headers with SSL support... found
OpenSSL development headers... found
Zlib development headers... found
Ruby development headers... found
OpenSSL support for Ruby... found
RubyGems... found
Your RVM wrapper scripts are too old.
Please update them first by running 'rvm update
--head && rvm reload && rvm repair all'.
I'm using Fedora 14, Ruby 1.9.2, Rails 3.0.7
RVM is installed for multiuser
I also get this error when I do 'passenger start'
Cannot execute
'/home/antarr/.passenger/standalone/3.0.7-x86_64-ruby1.9.2-linux-gcc4.5.1-1002/support/helper-scripts/prespawn
http://0.0.0.0:3000': Permission
denied (13)
I was having the same issue but found that using the rvmsudo command worked. Instead of
sudo passenger-install-apache2-module
try using:
rvmsudo passenger-install-apache2-module
It looks like Passenger 3.0.7 is confused by newer versions of rvm, but it seems like the instructions are incorrect and it's causing trouble. If the GEM_HOME environment variable is not set you get this error.
The correct instructions should be to use your particular version first:
rvm use 1.9.2
Although I got the same error as you, after that it worked for me.
If none of the above solutions work for you and you're getting the GEM_HOME warning
delete everything in .rvmrc
rvm get head && rvm reload && rvm repair all
gem install passenger
passenger-install-apache2-module
copy/paste the end message into your apache.conf
I am still having the same issue with passenger 3.0.19 if I tried to install on gemsets other than default and global. This is soooo troublesome. I have tried many suggestions and even rvm implode, then have everything brand new. but still hitting the brick wall. my forehead almost flatten. Hope not to lose my head!
Luckily, I found myself a fix. I found out that in i am in rvm multiuser envrioment and the issue arised if I switch to user gemset using command: "rvm user gemsets" which basically will create and use .rvm folder in user's home folder. e.g.: /home/.rvm instead of /ur/local/rvm folder. Since I do not know how to switch back and could not find any documention on how to, I did the following steps:
remove .rvm folder in the user home folder,
rm -rf ~username/.rvm
added back the user to rvm group (in multi enviroment, every new user need to be added to rvm group)
sudo usermod -a -G rvm username
re-login.
Now, as long as I am using shared rvm gemset folder, phusion passenger wont complaint.
Hope that helps someone.
I fixed the Permission Denied issue with:
chmod a+x /Users/tvd/.passenger/standalone/3.0.7-x86_64-ruby1.9.2-macosx-10.6/support/helper-scripts/*
Found it in comment section on the phusion.nl blog:
Goto Comment on Phusion Blog