Friday, July 27, 2012

The rvmrc located in '/x/y/z/path' could not be loaded, likely due to trust mechanisms. Please run 'rvm rvmrc {trust,untrust} '/x/y/z/path'' to continue, or set rvm_trust_rvmrcs_flag to 1. (RVM::ErrorLoadingRVMRC)


Environment:
Rails 3.2.6
ruby 1.9.3p194
Phusion Passenger version 3.0.13


Error message:
The rvmrc located in '/x/y/z/path'
could not be loaded, likely due to trust mechanisms. Please run 'rvm rvmrc
{trust,untrust} '/x/y/z/path'' to
continue, or set rvm_trust_rvmrcs_flag to 1. (RVM::ErrorLoadingRVMRC)

Problem:
Unknown, don't know what this is happening


Fix:
1. cd to /x/y/z/path and run `rvm rvmrc trust` on the command line, restart apache (this didn't work for me)
2. add rvm_trust_rvmrcs_flag=1 to ~/.rvmrc, restart apache (this worked for me)

Friday, July 13, 2012

You have already activated rack (gem name) 1.4.1(gem version), but your Gemfile requires rack (gem name) 1.3.6 (gem version)

Error message:
You have already activated rack (gem name) 1.4.1(gem version), but your Gemfile requires rack (gem name) 1.3.6 (gem version)

This could be any gem and any version, this is just my example using the rack gem.


Problem:
On my production machine I am using passenger 3.0.13 and it requires rack 1.4.1. In my Gemfile I am using Rails 3.1.3. Unfortunately rails 3.1.3 uses actionpack (and others) which depends on rack 1.3.6. I am not using rvm so rack 1.4.1 loads when passenger loads and therefore is loaded before rack 1.3.6. Since you can't have more than one version running, I get the error. Makes since, right?


Fix:
There are multiple possible fixes.
1. install rvm and add a gemset
2. (the one that I used) I decided to just upgrade rails to 3.2.6. This uses rack 1.4.1 and now all is happy :)
3. downgrade passenger to a version that uses rack 1.3.6

Friday, June 22, 2012

/path/to/.rvm/gems/ruby-1.9.3-p194@nameofgemset/gems/json-1.7.3/lib/json/ext/parser.bundle: [BUG] Segmentation fault ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.3.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02

Error message:
/path/to/.rvm/gems/ruby-1.9.3-p194@nameofgemset/gems/json-1.7.3/lib/json/ext/parser.bundle: [BUG] Segmentation fault ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.3.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02


Problem:
In my case the JSON gem has a compiled extension that might've been corrupted or rendered incompatible. I'm guessing this because of the error message in the passenger log file (error message above). This is possible for other gems as well not just JSON, basically any gem that requires a compiled extension.


Fix:
There are multiple possible fixes.
1. `gem install json`
2. (the one that worked for me) rebuild all gems with `gem pristine --all`


Good luck and hope this helps.

Wednesday, June 20, 2012

how to load passenger from apache with rvm and unique gem sets

So i kept getting errors that said ruby couldn't find a specific gem. Looking at the stack trace it shows the version of ruby you are using and the gemset. Of course you can create a custom gemset for each app you are working on, but the problem is that passenger doesn't read your custom gemset without extra configuration. So here is where I found the fix (read first answer):
http://stackoverflow.com/questions/5680341/how-to-load-passenger-from-apache-with-rvm-and-unique-gem-sets

Tuesday, May 15, 2012

Could not find multi_json in any sources

This just means that passenger is not reading the right ruby version or gemset or both.

I went through a lot of trouble to get this fixed. I ran rvm implode which removes rvm and all rubies. I then reinstalled it all. Reinstalled passenger gem and compiled it as well (passenger-install-apache-module).

I then created a .rvmrc file and said rvm use 1.9.3@mygemsetname. I changed directory to the app and ran bundle install. This is when I got the error again, so I thought a little more and just removed the rvmrc and ran bundle install again and that fixed it.

My apache conf file was:

   LoadModule passenger_module /Users/cgunnels/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
   PassengerRoot /Users/cgunnels/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12
   PassengerRuby /Users/cgunnels/.rvm/wrappers/ruby-1.9.3-p194/ruby

So I'm guessing that because I didn't specify a gemset in the apache conf in was reading the wrong gem list.

cannot load such file -- somerubyfile

Error message: 

cannot load such file -- config/init

Backtrace:
line 3: config.ru

So I was trying to load a sinatra app and I had this error keep coming up. I found out that all you have to do is add "./" to the front of the require like "./config/init" and all will load just fine.

Using:
ruby 1.9.3p194
Phusion Passenger version 3.0.12
sinatra (1.3.2)

Passenger encountered the following error: The application spawner server exited unexpectedly: Unexpected end-of-file detected.

For me I install the passenger gem with the --pre flag and that caused the problem. I just reinstalled it without the flag and this error went away for me.

I am using Mac OSX 10.7.3