You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sebastian Bazley <se...@apache.org> on 2016/03/18 17:53:11 UTC

[whimsy.git] [1/2] Commit 395987f: Don't insist on Ruby 2.3.0

Commit 395987f1782be77841275deaad5188e5d0925071:
    Don't insist on Ruby 2.3.0


Branch: refs/heads/master
Author: Sebb <se...@apache.org>
Committer: Sebb <se...@apache.org>
Pusher: sebb <se...@apache.org>

------------------------------------------------------------
www/status/Gemfile                                           | ++ -
www/status/passenger.cgi                                     | ++ ---
------------------------------------------------------------
8 changes: 4 additions, 4 deletions.
------------------------------------------------------------


diff --git a/www/status/Gemfile b/www/status/Gemfile
index bdc729a..f853090 100644
--- a/www/status/Gemfile
+++ b/www/status/Gemfile
@@ -1,6 +1,7 @@
 source 'https://rubygems.org'
 
-ruby '2.3.0'
+# N.B. It is recommended to use ruby 2.3.0, but 2.0.0 should work
+raise 'Ruby version must be at least 2.0' unless  RUBY_VERSION.to_f >= 2.0
 
 root = '../../..'
 asf_version = File.read(File.expand_path("#{root}/asf.version", __FILE__)).chomp
diff --git a/www/status/passenger.cgi b/www/status/passenger.cgi
index 4ccefea..ecca2b7 100755
--- a/www/status/passenger.cgi
+++ b/www/status/passenger.cgi
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby2.3.0
+#!/usr/bin/env ruby
 
 require 'bundler/setup'
 
@@ -15,8 +15,7 @@ unless user
   print "WWW-Authenticate: Basic realm=\"ASF Members and Officers\"\r\n\r\n"
   exit
 end
-
-output, error, status = Open3.capture3 '/usr/local/bin/ruby2.3.0',
+output, error, status = Open3.capture3 'ruby',
   Gem.bin_path('passenger', 'passenger-status')
 
 _html do

Re: [whimsy.git] [1/2] Commit 395987f: Don't insist on Ruby 2.3.0

Posted by sebb <se...@gmail.com>.
On 18 March 2016 at 18:18, Sam Ruby <ru...@intertwingly.net> wrote:
> This doesn't work, as you can see here:
>
> https://whimsy.apache.org/status/passenger

Rats; it worked for me.

> The version of Ruby used must match the one specified in the apache config
> (/etc/apache2/mods-enabled/passenger.conf on whimsy-vm2).  This is
> important in both places: in the call to Open3.capture3, and in the
> call go Gem.bin_path.

This is going to make it potentially tricky to run locally.
I fixed my system by linking ruby2.3.0 to ruby, but that's a bit messy.

Also when ruby is updated, the script will have to be changed.

Maybe there needs to be a fixed executable name (e.g. ruby4passenger)
which is used everywhere?

That would only require updating a single link.

> - Sam Ruby
>
> On Fri, Mar 18, 2016 at 12:53 PM, Sebastian Bazley <se...@apache.org> wrote:
>> Commit 395987f1782be77841275deaad5188e5d0925071:
>>     Don't insist on Ruby 2.3.0
>>
>> diff --git a/www/status/passenger.cgi b/www/status/passenger.cgi
>> index 4ccefea..ecca2b7 100755
>> --- a/www/status/passenger.cgi
>> +++ b/www/status/passenger.cgi
>> @@ -1,4 +1,4 @@
>> -#!/usr/local/bin/ruby2.3.0
>> +#!/usr/bin/env ruby
>>
>>  require 'bundler/setup'
>>
>> @@ -15,8 +15,7 @@ unless user
>>    print "WWW-Authenticate: Basic realm=\"ASF Members and Officers\"\r\n\r\n"
>>    exit
>>  end
>> -
>> -output, error, status = Open3.capture3 '/usr/local/bin/ruby2.3.0',
>> +output, error, status = Open3.capture3 'ruby',
>>    Gem.bin_path('passenger', 'passenger-status')
>>
>>  _html do

Re: [whimsy.git] [1/2] Commit 395987f: Don't insist on Ruby 2.3.0

Posted by Sam Ruby <ru...@intertwingly.net>.
This doesn't work, as you can see here:

https://whimsy.apache.org/status/passenger

The version of Ruby used must match the one specified in the apache config
(/etc/apache2/mods-enabled/passenger.conf on whimsy-vm2).  This is
important in both places: in the call to Open3.capture3, and in the
call go Gem.bin_path.

- Sam Ruby

On Fri, Mar 18, 2016 at 12:53 PM, Sebastian Bazley <se...@apache.org> wrote:
> Commit 395987f1782be77841275deaad5188e5d0925071:
>     Don't insist on Ruby 2.3.0
>
> diff --git a/www/status/passenger.cgi b/www/status/passenger.cgi
> index 4ccefea..ecca2b7 100755
> --- a/www/status/passenger.cgi
> +++ b/www/status/passenger.cgi
> @@ -1,4 +1,4 @@
> -#!/usr/local/bin/ruby2.3.0
> +#!/usr/bin/env ruby
>
>  require 'bundler/setup'
>
> @@ -15,8 +15,7 @@ unless user
>    print "WWW-Authenticate: Basic realm=\"ASF Members and Officers\"\r\n\r\n"
>    exit
>  end
> -
> -output, error, status = Open3.capture3 '/usr/local/bin/ruby2.3.0',
> +output, error, status = Open3.capture3 'ruby',
>    Gem.bin_path('passenger', 'passenger-status')
>
>  _html do