Passenger module fails to install - rvm

On Mac OSX 10.8.4, I'm running:
sudo passenger-install-apache2-module
which suggested:
Your RVM wrapper scripts are too old, or some wrapper scripts are missing. Please update/regenerate them first by running:
rvmsudo rvm get stable && rvm reload && rvmsudo rvm repair all
If that doesn't seem to work, please run:
rvmsudo rvm wrapper [] --no-prefix --all
I did the first bit, re-ran the passenger-install-apache2-module but got the same problem. Then I did the second part. This gave:
awk: nonterminated character class ^[]=
source line number 1
context is
>>> /^[]=/ <<<
sed: 1: "s#^[]=##
": unbalanced brackets ([])
Unknown ruby interpreter string component: '[]'.
Could not load ruby [].
Any suggestions on where I go from here?

just run passenger-install-apache2-module do not prefix it with sudo.
the command will tell you what to do if it has no write access into required locations.
using sudo losses all environment variables - which basically breaks what rvm set up.
if you would really need root privileges you should use rvmsudo which does preserve all required environment variables.

Related

zsh: command not found: rvm-prompt

After I remove rvm (ruby version manager), the zsh aways came out:
zsh: command not found: rvm-prompt
Is there something I did not clear?
But I had remove all of rvm files and script in zshrc or bash_profile ...
It seems that you are using a theme which uses rvm-prompt like "fino-time".
from the looks of it, you might be calling that command from your prompt definition.
Your .zshrc or .zshenv is likely sourcing $HOME/.rvm/scripts/rvm (which you do not want to do anymore, now that you removed it from your system)

No .rvm directory after installing rvm

I don't have a ~/.rvm file even after I upgrade my version of RVM using:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
This command produces the following. How can I make sure a .rvm folder is created?
Upgrading the RVM installation in /opt/t/rvm/
chown: rvm: illegal group name
chown: rvm: illegal group name
RVM PATH line found in /Users/ros/.bashrc /Users/roseperrone/.zshrc.
RVM sourcing line found in /Users/ros/.bash_profile /Users/roseperrone/.zprofile.
Upgrade Notes:
* No new notes to display.
# RVM: Shell scripts enabling management of multiple ruby environments.
# RTFM: https://rvm.io/
# HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
# Cheatsheet: http://cheat.errtheblog.com/s/rvm
# Screencast: http://screencasts.org/episodes/how-to-use-rvm
# In case of any issues run 'rvm requirements' or read 'rvm notes'
Upgrade of RVM in /opt/t/rvm/ is complete.
You don't have a ~/.rvm, because you installed rvm to /opt/t/rvm/.
You may either just live with that and use /opt/t/rvm/ instead of ~/.rvm. Or remove rvm completely and make a new install (which should then default to ~/.rvm).

Error on terminal start

-bash: /etc/profile.d/rvm.sh: No such file or directory
-bash: /Users/janekambani/.bash_profile: line 1: conditional binary operator expected
-bash: /Users/janekambani/.bash_profile: line 1: syntax error near `"$HOME/.rvm/scripts/rvm"'
-bash: /Users/janekambani/.bash_profile: line 1: `[[ -s "$HOME/.rvm/scripts/rvm"]] && . "$HOME/.rvm/scripts/rvm" '
I tried this:
sudo rm -rf /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm /usr/local/bin/rvm $HOME/.rvm $HOME/.rvmrc
but i still kept getting the same error.
im using OS X 10.8
Take a look at the source of /etc/profile.
On 10.8 of Mac OS, installing RVM while using sudo, adds a line to /etc/profile.d/rvm.sh. Even if you remove RVM using rvm implode, that one liner stays in there and will cause that error to show on start up of any terminal.
Use your favorite text editor (nano,vim, etc) to open /etc/profile and comment out these two lines:
source /etc/profile.d/sm.sh
source /etc/profile.d/rvm.sh
Then save the file.
To fix any issues with sourcing RVM use:
rvm get stable --auto-dotfiles #OR:
rvm get head --auto-dotfiles
It will remove existing sourcing lines and add new ones that are meant to work.
This is happening due to a botched installation of RVM (at least the part that tried to install the shell loader was botched). Did you recently try to install RVM?
Something kept trying to insert the RVM load code and it has made a mess.
Here is my suggestion:
Make a backup copy of your .bash_profile.
Open it in a text editor and remove everything but:
export PATH=/Applications/SenchaSDKTools-2.0.0-Developer-Preview:$PATH
export PATH=/Applications/SenchaSDKTools-2.0.0-Developer-Preview/command:$PATH
export PATH=/Applications/SenchaSDKTools-2.0.0-Developer-Preview/jsbuilder:$PATH
Add this line below that:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Save it and open another terminal and see if the error goes away.

Guard complaints about running outside of Bundler, but only on 2nd terminal window onwards

I am following Michael Hartl's tutorial and ran this 2 blocks of code
$ rvm get head && rvm reload
$ chmod +x $rvm_path/hooks/after_cd_bundler
$ cd ~/rails_projects/sample_app
$ bundle install --without production --binstubs=./bundler_stubs
now when I run Guard on my first terminal window everything is fine, but when I open another terminal window and run the exact same command, it complaints that I am running Guard outside of Bundler. Why is that so?
Still can't post images but here is the screenshot of the 2 separate terminal windows
terminal 1
terminal 2
Thanks!
Ryan
tests
rvm current - is the proper ruby selected
echo $PATH - first position should be path to .../bundler_stubs
solutions
for both errors it might work again with cd . - but this might be problematic
you need to make sure that RVM was loaded properly, and that proper ruby was loaded in session:
make sure you use gnome-terminal with login session enabled: https://rvm.beginrescueend.com/integration/gnome-terminal/
run rvm get head --auto - keep a gist of it in case
restart your computer - it's required in some cases
make sure you do not overwrite PATH after RVM was loaded in your RC scripts

Problem with RVM use

I am having trouble with using rvm use in zsh. Whenever I do rvm use 1.9.2 or other ruby version, it gives confirmation as Using /home/kxhitiz/.rvm/gems/ruby-1.9.2-p290
But when I do rvm list ruby 1.9.2 is not selected. This works fine in bash. That means I can go to bash and select ruby version I need, and I can come back to zsh to use it.
So that means if I have to change ruby from list of rubies I have installed, I have to go to bash to select it and once selected in bash, I can see it selected in zsh as well.
Any solution would be highly appreciated.
Ok, I did fixed it by adding following line at the end of my ~/.zshrc file
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Cheers!