Passenger 3.0 and debugger - ruby-on-rails

I have problems using passenger standalone with a debugger. If I try this:
passenger start --debugger
I get this error:
Your version of ruby-debug is too old. Please upgrade to the latest version.
My Ruby is: ruby 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.02
Ruby debug:
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
So, has anyone successfully used Passenger 3.0 with a debugger?

It isn't supposed to work, the flag was experimental but we forgot to remove it for 3.0.0, that's why it isn't documented. It'll be removed for 3.0.1.

You can run a debugger in Passenger by using rack-debug
It works by having a client connect to the Passenger process at the breakpoints you set. A bit more complicated than using Thing/Mongrel with a debugger. But pretty simple to setup.

Related

configuring VPS for Ruby on rails app...which version of Ruby to use?

I'm configuring my first VPS for my first ruby on rails app that I´m soon deploying to the web.
I'm following this documentation https://gorails.com/deploy/ubuntu/16.04
it is going greate, but I just realised that my version of Ruby is ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15] and the recommended for the setup is ruby version 2.3.1.
So do I have to update the ruby version on my computer to 2.3.1 or is it ok to deploy an app build on ruby 2.2.3 to an server running version 2.3.1.
This might be a stupid question, but I just want to be sure because I lack experience and I´m setting up VPS for the first time.
p.s
The App soon to deployed is built in rails 4.2.5
It is totally fine if you use Ruby 2.2.3 in this circumstance because there's not much difference between Ruby 2.2.3 and 2.3.1, they are all minor versions of Ruby 2.0.0. In addition, Rails 4.2.5 works normally with both of them.

Error using heroku_san gem: Your Ruby version is x.x.x, but your Gemfile specified x.x.x (Bundler::RubyVersionMismatch)

After upgrading a Rails application to use Ruby 2.0.0 (from 1.9.3), I started receiving this error when attempting to deploy to Heroku via rake <stage> deploy.
Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0 (Bundler::RubyVersionMismatch)
It also seems to cause this error, (but I can run the Heroku commands manually without the heroku_san helpers, so authorization is not the issue).
Expected(200) <=> Actual(401 Unauthorized)
I updated the gems to the latest version, and also updated the Heroku Toolbelt.
I found this pull request and patched my version, but the error persisted.
How do I solve this (on both Ubuntu & OSX)?
Other info:
Ubuntu 12.04 LTS x64
Rails 3.2.13
Ruby 2.0.0-p247
heroku-api-0.3.15
heroku_san-4.0.8
heroku-toolbelt/2.41.0 (x86_64-linux)
rvm 1.22.10
The solution for me on Ubuntu was to modify
/usr/local/heroku/bin/heroku
And change the shebang line to
#!/usr/bin/env ruby
Thanks goes to Pivotal Labs for this.
(I don't use a Mac.)
Another issue I found with this error (1.9.2 not 1.9.3) is having BUNDLE_GEMFILE env variable set on heroku which causes heroku ruby build pack to freak and default to 1.9.2.

Does jruby 1.6.5 compatible with rails 2.3.10?

Did anyone tried with jruby 1.6.5 to work with rails 2.3.10 or 2.3.x version ?
it sure is and I recommend you go with the latest 1.6 which is 1.6.8
jruby-1.6.x is ruby 1.8.7 compatible which is "ideal" for rails 2.3.x
try running jruby -v you'll get something like:
jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM) Server VM 1.6.0_32) [linux-i386-java]
reporting ruby-1.8.7-p357 compatibility (in --1.8 mode) ...
if you're about to use a Java webserver such as Trinidad (or Warbler) that uses JRuby-Rack as the compatibility layer between Rack/Rails and Servlets be sure to use (~> 1.1.13) 1.1.13.3 it's (backwards) compatible with all JRuby 1.6.x and runs Rails 2.3x (as well).
Well, I would just give it a try. JRuby 1.6.5 tries to be complient to Ruby 1.9.x, so the real question could be one of these:
is Ruby 1.9 compatible with rails 2.3?
Is it feasible to use Ruby 1.9 for Rails yet?
I don't remember what you had to to to use Rails 2.3.x, but if should be similar easy to do the following steps (if you have used rvm to install JRuby 1.6.5):
rvm use jruby1.6.5
Start your ruby application.
Add the gems that are missing by doing: gem install <missing-gem> -r
And as the real answer: No, I did not try to use JRuby 1.6.5, because I switched all Rails apps to 3.x long before JRuby 1.6.5 came out.

Passenger/Nginx error "unexpected end of file detected."

I'm trying to run my applications under Passenger 3.0.2 on Mac OSX 10.6.4 with Rails 2.3.8 and 3.0.4. Using Ruby EE v2011.01. And Nginx.
I have completed this successfully on my laptop, and on a Redhat server. However, on my Mac Pro I am getting the following on both apps:
Passenger encountered the following error:
The application spawner server exited unexpectedly: Unexpected end-of-file detected.
Nginx log file shows a segmentation fault:
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/utils.rb:708: [BUG] Segmentation fault
ruby 1.8.7 (2010-12-23 patchlevel 330) [i686-darwin10.4.0], MBARI 0x6770, Ruby Enterprise Edition 2011.01
I KNOW this has to be some gem issue. Unfortunately Passenger is not reporting it, and I have it's log level set to 3.
I have seen a few logging issues in Passenger that have caused me some headaches. I'm not complaining, it's free and it's fast. But I don't know how to get past this one.
Looks like some kind of Ruby bug to me. Try 1.9? It looks like the Ruby core developers give 1.9 more attention than 1.8 these days.
I got same problem with Ruby Enterprise (ree) 1.8.7-2011.02 and install Passenger that bundle with it.
Server is OpenSuSe 11.x
Ruby Enterprise 1.8.7-2011.02
Passenger 3.0.2
/var/log/apache2/error_log show looks like this
*** glibc detected *** Passenger ApplicationSpawner: /srv/www/apps/xxxxxx/current: munmap_chunk(): invalid pointer: 0x0000000000ccd400 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x73226)[0x7f40d5d1e226]
/lib64/libnsl.so.1(+0xfd4a)[0x7f40d40f3d4a]
/lib64/libpthread.so.0(pthread_once+0x53)[0x7f40d5a9a943]
/lib64/libnsl.so.1(_nsl_default_nss+0x21)[0x7f40d40f3e61]
/lib64/libnss_compat.so.2(_nss_compat_initgroups_dyn+0x594)[0x7f40d4301de4]
/lib64/libc.so.6(+0x9cc1b)[0x7f40d5d47c1b]
/lib64/libc.so.6(initgroups+0x6c)[0x7f40d5d47e7c]
/opt/ruby-enterprise-1.8.7-2011.02/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/phusion_passenger/native_support.so(+0xf48)[0x7f40d4b5af48]
so, solution is install Passenger gem to your MRI Ruby.
sudo gem install passenger
sudo passenger-install-apache2-module
Last report of passenger should give you apache's configuration to MRI ruby /usr/bin/ruby
It is slower but till new patch is out, this is only solution for me.
Had the same error (on ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.5.0],
passenger 3.0.2, Mac OS X 10.6.6 dual Quad-Core) and reverting to Passenger 2.2.15 also worked for me. Weird! Thank you.
Backing off to Passenger 2.2.15 fixed my problem. Note that this error only occurs on Mac OS X 10.6.4 on my Mac Pro dual quad core CPU machine, NOT on my MacBook Pro laptop running the same version of the OS.

Anyone Try Running Rails 2.2 (or Edge) under Ruby 1.9.1 RC1

Ruby 1.9.1 RC1 was released today so I quickly moved to install it (a test version of course using a suffix of 19). I install Rails and Rack for the 1.9 RubyGems and then create a new Rails site using edge... when I execute:
ruby19 ./script/server
I watch as the processor usage goes up to 99.8 and the terminal just sits there. Trying to run Rails 2.2 using 1.9.1RC1 gives all sorts of fail on the inflector. I was under the impression that Rails 2.2 was 1.9.1 compatible. Is anyone successfully testing Rails under Ruby 1.9.1 or are you seeing similar errors?
The same thing for me.
I'm running the latest edge rails under webrik and just see the blank screen and no response to Ctrl-C. Rails 2.2 isn't working at all.
Also, I've tried run edge under thin (with eventmachine from github fixed to build on ruby 1.9.1, except one broken ruby test - I've just added empty one with 'assert true').
After that, both webrick and thin crashes immediately with:
$ /usr/local/bin/ruby script/server
/usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.3/lib/rubyeventmachine.bundle: [BUG] Bus Error
ruby 1.9.1 (2008-12-30 patchlevel-0 revision 21203) [i386-darwin9.6.0]
So, I guess, we all need calm down now. There still much work to actually run our rails apps under 1.9.1. Many gems are still at the early stages of bringing compatibility with 1.9.1
Actually, rails 2.2 is not fully compatible with ruby 1.9.1, just a basic compatibility, according to rails core team :)
Full compatibility claimed in upcoming rails 2.3.
I have written a guide on using Rails edge (near enough to 2.3) and Ruby 1.9.1. mysql, postgres and a few other gems like hpricot, thin and mongrel don't work, but the application does work.
Rails 2.2.2 is not compatible with Ruby 1.9.1rc1 when processing characters and strings on ActiveSupport. Rails uses multibyte to support unicode char-set, in other hand Ruby 1.9.1 uses built-in unicode support. Supported versions is 1.8.5 to 1.8.7.

Resources