Ruby and Ruby on Rails version - Openshift

Asked

Viewed 121 times

2

I tried to upload an application made in Ruby 2 and Ror 4 in Openshift and could not.

Is an application made in Ruby 2 compatible with Ruby 1.9? What versions are supported by Openshift?

Follow the error:

==> app-root/logs/mysql.log <==
        140507 22:54:28 InnoDB: highest supported file format is Barracuda.
        140507 22:54:28  InnoDB: Waiting for the background threads to start
        140507 22:54:29 InnoDB: 5.5.36 started; log sequence number 1595675
        140507 22:54:29 [Note] Server hostname (bind-address): '127.8.120.2'; port: 3306
    140507 22:54:29 [Note]   - '127.8.120.2' resolves to '127.8.120.2';
    140507 22:54:29 [Note] Server socket created on IP: '127.8.120.2'.
    140507 22:54:29 [Warning] 'proxies_priv' entry '@ [email protected]' ignored in --skip-name-resolve mode.
    140507 22:54:29 [Note] Event Scheduler: Loaded 0 events
    140507 22:54:29 [Note] /opt/rh/mysql55/root/usr/libexec/mysqld: ready for connections.
    Version: '5.5.36'  socket: '/var/lib/openshift/536aeaba4382ece46b00023b/mysql//socket/mysql.sock'  port: 3306  MySQL Community Server (GPL)

    ==> app-root/logs/ruby.log <==
        from /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in `eval'
        from /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in `result'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/html_template.rb:46:in `result'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:328:in `send_error_page'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:297:in `rescue in handle_spawn_application'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:274:in `handle_spawn_application'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/helper-scripts/passenger-spawn-server:102:in `<main>'
    200.18.252.45 - - [08/May/2014:16:31:28 -0400] "GET /favicon.ico HTTP/1.1" 200 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
    *** Exception SyntaxError in Class (/var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/app/controllers/avaliacoes_controller.rb:9: invalid multibyte char (US-ASCII)
    /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/app/controllers/avaliacoes_controller.rb:9: invalid multibyte char (US-ASCII)
    /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/app/controllers/avaliacoes_controller.rb:9: syntax error, unexpected $end, expecting ':'
    ...== 1 ? flash[:success] = "Você curtiu #{@avaliacao.item.nom...
    ...                               ^) (process 289738, thread #<Thread:0x00000000f35110>):
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `block in require'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:348:in `require_or_load'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:307:in `depend_on'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:225:in `require_dependency'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/engine.rb:468:in `block (2 levels) in eager_load!'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/engine.rb:467:in `each'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/engine.rb:467:in `block in eager_load!'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/engine.rb:465:in `each'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/engine.rb:465:in `eager_load!'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/engine.rb:346:in `eager_load!'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/application/finisher.rb:58:in `each'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/application/finisher.rb:58:in `block in <module:Finisher>'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `instance_exec'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `run'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /opt/rh/ruby193/root/usr/share/ruby/tsort.rb:150:in `block in tsort_each'
        from /opt/rh/ruby193/root/usr/share/ruby/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
        from /opt/rh/ruby193/root/usr/share/ruby/tsort.rb:219:in `each_strongly_connected_component_from'
        from /opt/rh/ruby193/root/usr/share/ruby/tsort.rb:182:in `block in each_strongly_connected_component'
        from /opt/rh/ruby193/root/usr/share/ruby/tsort.rb:180:in `each'
        from /opt/rh/ruby193/root/usr/share/ruby/tsort.rb:180:in `each_strongly_connected_component'
        from /opt/rh/ruby193/root/usr/share/ruby/tsort.rb:148:in `tsort_each'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/initializable.rb:54:in `run_initializers'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-4.1.0/lib/rails/application.rb:288:in `initialize!'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/config/environment.rb:5:in `<top (required)>'
        from config.ru:3:in `require'
        from config.ru:3:in `block in <main>'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
        from /var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
        from config.ru:1:in `new'
        from config.ru:1:in `<main>'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/rack/application_spawner.rb:225:in `eval'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/rack/application_spawner.rb:225:in `load_rack_app'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/rack/application_spawner.rb:75:in `block (2 levels) in spawn_application'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/utils.rb:563:in `report_app_init_status'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/rack/application_spawner.rb:73:in `block in spawn_application'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/utils.rb:470:in `safe_fork'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/rack/application_spawner.rb:64:in `spawn_application'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:264:in `spawn_rack_application'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/helper-scripts/passenger-spawn-server:102:in `<main>'
    [ pid=353530 thr=140007617968096 file=ext/apache2/Hooks.cpp:884 time=2014-05-08 16:33:47.332 ]: Unexpected error in mod_passenger: Cannot spawn application '/var/lib/openshift/536aeaba4382ece46b00023b/app-root/runtime/repo': The spawn server has exited unexpectedly.
      Backtrace:
         in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:742)
         in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:312)
         in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:585)
    200.18.252.45 - - [08/May/2014:16:33:34 -0400] "GET / HTTP/1.1" 500 629 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
    *** Exception ArgumentError in spawn manager (invalid byte sequence in US-ASCII) (process 289738, thread #<Thread:0x00000000f35110>):
        from /opt/rh/ruby193/root/usr/share/ruby/erb.rb:912:in `gsub'
        from /opt/rh/ruby193/root/usr/share/ruby/erb.rb:912:in `html_escape'
        from (erb):47:in `block in result'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/html_template.rb:63:in `block in layout'
        from (erb):22:in `get_binding'
        from /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in `eval'
        from /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in `result'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/html_template.rb:66:in `layout'
        from (erb):1:in `result'
        from /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in `eval'
        from /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in `result'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/html_template.rb:46:in `result'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:328:in `send_error_page'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:297:in `rescue in handle_spawn_application'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/spawn_manager.rb:274:in `handle_spawn_application'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
        from /opt/rh/ruby193/root/usr/share/gems/gems/passenger-3.0.21/helper-scripts/passenger-spawn-server:102:in `<main>'

2 answers

1

I’ll answer back and forth. You ask:

Is an application made in Ruby 2 compatible with Ruby 1.9? What versions are supported by Openshift?

So according to her own ruby-lang.org:

Compatibility

We have also Taken care with the 2.0.0 design to make it compatible with 1.9. It will be easier to migrate from 1.9 to 2.0 than it was from 1.8 to 1.9. (The notable incompatibilities are described later.)

And the problems of incompatibility:

Incompatibility

There are five notable incompatibilities we know of:

  • The default encoding for ruby scripts is now UTF-8 [#6679]. Some people report that it affects existing Programs, such as some benchmark Programs Becoming very slow [ruby-dev:46547].

  • Iconv was Removed, which had already been deprecated when M17N was introduced in ruby 1.9. Use String#Encode, etc. Instead. There is ABI breakage [ruby-core:48984].

  • We think that normal users can/should just reinstall Extension Libraries. You should be Aware: DO NOT COPY . so OR . Bundle FILES FROM 1.9.

  • #lines, #chars, #codepoints, #bytes now Returns an Array Instead of an Enumerator [#6670]. This change Allows you to avoid the common idiom "Lines.to_a". Use #each_line, etc. to get an Enumerator.

  • Object#Inspect does Always Return a string like # Instead of delegating to #to_s. [#2152]

There are some comparatively small incompatibilities. [ruby-core:49119]

Now, as far as Openshift is concerned, according to this text, "Ruby 2.0.0-P0 (patch level zero) is out" (Ruby 2.0.0-P0 (...) is released), but you must download it by rbenv or rpm - still according to the text, rbenv better.


Knowing your questions, I’ll relaunch you another:

I tried to upload an application made in Ruby 2 and Ror 4 in Openshift and could not.

What was the mistake specifically and after all?

  • I added the error in the log.

1

The versions of Ruby available in Openshift Online are 1.8 and 1.9, and so you should be showing this error you described, see that in your log appears the path /opt/Rh/ruby193/.

The list of available cartridges you find in this link https://www.openshift.com/developers/technologies.

In your file /app/controllers/values_controller.Rb are there non-ASCII characters? In this case it is necessary to include # encoding: utf-8 in the first line of it.

  • Yes, they still can’t stand the 2.0! Too bad. I’ll continue developing site then :/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.