Need help setting up passenger with RVM - ruby-on-rails-3

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

Related

Unable to install ruby using RVM on WSL 2 and Ubuntu

I have a windows 10 machine with WSL 2 and Ubuntu 20.x installed. I installed RVM on Ubuntu. RVM seems to be installed fine, but when I try and install a ruby rvm install 3.1.2 I get the error mkdir: cannot create directory ‘/usr/share/rvm/log/1658255479_ruby-3.1.2’: Permission denied Anything special I should be doing on WSL 2 to make this work?
I can reproduce this exact error if I try rvm install 3.1.2 without having added my user to the rvm group per the installation instructions. Is it possible that you missed this step?
sudo usermod -a -G rvm $USER
After adding the user, then exiting the shell/WSL and restarting, rvm install 3.1.2 (almost) worked as expected. It appears there's a slight bug where it asks for the sudo password on the same line as a previous Updating system.. line, so it's easy to miss, but this is recoverable.

RVM is not a function in Raspbian RVM Installation

I'm looking for a solution to the "RVM is not a function" issue when installing RVM on Raspbian using LXTerminal. The following thread discusses workarounds for this issue:
rvm installation not working: "RVM is not a function"
One solution would be to start the terminal in "login mode" by doing /bin/bash --login, but this does not help on Raspbian because it uses LXTerminal. Other people have suggested putting the following line at the end of your .bash_rc file:
source ~/.rvm/scripts/rvm
...which seems to work. Just wondering if (a) the above workaround is legit and will not screw anything up and (b) if anybody has found a more elegant solution for RVM on Raspbian.
It looks like the best solution is to run it with:
lxterminal -e "bash -li"
It will make the terminal use an login and interactive shell.
I tried this but when in the root application directory for a ruby on rails application it stopped working, I added this 'source /usr/local/rvm/scripts/rvm' to my .bashrc file which worked in the /home/user/ folder and the root ruby on rails application folder

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!

RVM error with deploying Rails app via Capistrano

History:
Read into Deploying Rails3 app to a
Mediatemple DV server.
Installed RVM on the server, ruby, and essential gems.
Site works fine if I FTP it up.
All good.
I then decided to do a proper deployment and setup for GIT/cap deploy as per "Agile Web Development with Rails".
Attempted deploy with cap, but had errors with gems not available to the production site.
Read around and realised I should probably go for a system wide RVM install.
Removed all gems and RVM.
Installed RVM system wide.
Error on cap deploy "bash: /home/foo/.rvm/bin/rvm-shell: No such file or directory", which makes sense - there is no .rvm/ in the home directory.
Thinking something was hanging over from initially installing RVM to use as a user, I removed the user, deleting the home directory, and recreated the user with permissions.
Same error on cap deploy "bash: /home/foo/.rvm/bin/rvm-shell: No such file or directory"
The situation now is:
For foo, .bashrc contains the last line:
[[ -s '/usr/local/lib/rvm' ]] && source '/usr/local/lib/rvm'
When I issue:
type rvm | head -1
the response is "rvm is a function".
/etc/rvmrc contains
if [[ ! -s "$HOME/.rvm/scripts/rvm" ]]; then
umask g+w
export rvm_selfcontained=0
export rvm_prefix="/usr/local/"
fi
Running out of ideas here, and hoping for some suggestions.
Next time try to add this in your capistrano:
set :rvm_type, :system
It seems like rvm-shell is not in your rvm install directory. Run this command
rvm get head
Then you'll get it right in your rvm bin directory.
I just wanted to add to #imonyse's comment.
the head branch of rvm might be a tad too unstable for some deploys. I know our deprecated SLES boxes have a tendency to choke on it. It might be advisable to get the most recent stable version.
rvm get stable
Also don't do this on a really old server running production code as it may have undesired consequences.

Rails 3: Ruby 1.9.2: does it need /usr/bin/ruby1.8?

I am trying to get the Rails tutorial by Michael Hartl going. I spent a lot of time fighting various libraries. So I removed all ruby software from my Ubuntu 10.4 system.
Then I installed Ruby 1.9.2.
$ ruby -v
ruby 1.9.2dev (2010-07-02) [i486-linux]
So far so good. Then I did
sudo gem install rails
After a long time, it finished the installation.
Then I ran
$ rails -v
bash: /usr/bin/rails: /usr/bin/ruby1.8: bad interpreter: No such file or directory
So...I have no /usr/bin/ruby1.8 on my system. How do I get Rails 3.0.3 to use my ruby at /usr/bin/ruby?
I appreciate any help you can give me.
Just to see if I could keep going, I tried
$ cd /usr/bin
$ sudo ln -s ruby1.9.2 ruby1.8
This let me keep going, but is it the right thing to do?
It took trying 3 different methods of installing and uninstalling Ruby, but I finally got it!
I found a great tutorial by Toran Billups which gives some great instructions. After analyzing what he did, it comes down to a few key concepts:
Some libraries that are independent of the Ruby version must be installed in the system (using "sudo apt-get").
Use RVM to install Ruby in your own account. i.e. no "sudo".
Use gem to install gems in your particular ruby environment. (i.e. no "sudo"). When you set 1.8 as the Ruby environment, the gems are installed in the RVM 1.8 tree in your environment. When you set 1.9.2 as the environment, gems are installed in the 1.9.2 tree in your environment.
Here, then, is the process.
Remove all Ruby programs (1.8.x and 1.9.2) and Ruby libraries from your Ubuntu 10.4 system.
Install RVM on your system, following the instructions at the RVM site(broken) RVM site.
Follow Toran Billups' tutorial, starting at the point where you install Ruby 1.8.7.
Follow the instructions at Michael Hartl's tutorial(broken) Michael Hartl's tutorial to get Rails 3.0 working with Ruby 1.9.2, github, heroku.com, rspec, spork, and autotest.
I had the same error after installing with RVM and opening new shells. The solution was to run:
$ rvm use 1.9.2 --default
P.S.
I'm running Ubuntu 10.04 and after two days of trial and error finally got rails 3 working with ruby 1.9.2. I highly recommend using RVM to install ruby a godsend!
By the sounds of it Bash is finding ruby1.8 when its running the #!/usr/bin/env ruby line from the rails script, even though it doesn't exist. Try /usr/bin/env which ruby to see exactly what interpreter it's trying to load.
I was also having a headache with this, and don't want to use RVM right now.
I saw that the shebang line for /usr/bin/gem was #!/usr/bin/ruby1.8 and that this was presumably the issue.
I made sure /etc/alternatives pointed to the correct gem script; this can be set with:
update-alternatives --config gem
Then I removed /usr/bin/gem and symlinked from /usr/bin/gem to /etc/alternatives/gem
It turns out the only difference in the gem scripts was the shebang line, so manually changing that would have worked too.
Solved by changing back the version of my current Ruby (using RVM) to 2.0.x.
When i installed rails (two days ago) it was under the 2.0.0 version. Yesterday i changed to 2.1.x. Today i tried the rails command and got the error.
So turning back to the RVM Ruby version i installed rails did the trick.
Sorry by the bad english.
P.S. Using Ubuntu 13.10