[Tip] La eterna odisea del Bundle Install en Ruby Phusion Passenger – cPanel

Nada, este es un pequeño post para recordar que aún sigo vivo y sigo trasteando y haciendo idioteces con Ruby on Rails y esta vez en cPanel, para dar más grimilla aún.

 

He migrado de servidor mi cPanel hacia otro más económico y la verdad es que para volver a montarlo todo es un pim pam, excepto para los casos de RoR.

En cPanel no se puede usar nada más que no sea Phusion Passenger, lo instalaremos mediante paquete Yum en CentOS.

Hasta aquí todo lo bonito, ahora…. ¿Cómo puñetas hago que cpanel instale todas las gems de mi Bundler?

Ahora viene la odisea….

[dondebailas@gestion Ruby]$ scl enable ea-ruby24 'bundle install'
Fetching gem metadata from https://rubygems.org/..........
Fetching rake 12.3.0
Installing rake 12.3.0
Fetching concurrent-ruby 1.0.5
Installing concurrent-ruby 1.0.5
Fetching i18n 0.9.5
Installing i18n 0.9.5
Fetching json 1.8.6
Installing json 1.8.6 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

Empezamos bien…. no instala json… WHY?

Me pongo a buscar y resulta que hay un bugardo enorme en la versión de Passenger que yo tengo instalada… o mejor dicho, en la gema Bundler…

Sin contar, evidentemente que me faltaron estos dos paquetes: ea-ruby24-ruby-devel ea-apache24-devel


Todo bien, todo bonito, hasta que se me ocurre mirar qué versión de bundler estoy usando…

[dondebailas@gestion ~]$ scl enable ea-ruby24 'gem install bundler --user-install'
Successfully installed bundler-1.16.4
Parsing documentation for bundler-1.16.4
Done installing documentation for bundler after 7 seconds
1 gem installed

Ok……. instalemos pues una versión anterior…

[dondebailas@gestion ~]$ scl enable ea-ruby24 'gem install bundler -v '1.16.3' --user-install'
Fetching: bundler-1.16.3.gem (100%)
Successfully installed bundler-1.16.3
Parsing documentation for bundler-1.16.3
Installing ri documentation for bundler-1.16.3
Done installing documentation for bundler after 10 seconds
1 gem installed

 

[dondebailas@gestion Ruby]$ scl enable ea-ruby24 'bundle install'
Fetching gem metadata from https://rubygems.org/..........
Using rake 12.3.0
Using concurrent-ruby 1.0.5
Using i18n 0.9.5
Fetching json 1.8.6
Installing json 1.8.6 with native extensions
Fetching minitest 5.11.3
Installing minitest 5.11.3
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching tzinfo 1.2.5
Installing tzinfo 1.2.5
Fetching activesupport 4.2.4
Installing activesupport 4.2.4
Fetching builder 3.2.3
Installing builder 3.2.3
Fetching erubis 2.7.0
Installing erubis 2.7.0
Fetching mini_portile2 2.3.0
Installing mini_portile2 2.3.0
Fetching nokogiri 1.8.2
Installing nokogiri 1.8.2 with native extensions
Fetching rails-deprecated_sanitizer 1.0.3
Installing rails-deprecated_sanitizer 1.0.3
Fetching rails-dom-testing 1.0.9
Installing rails-dom-testing 1.0.9
Fetching crass 1.0.3
Installing crass 1.0.3
Fetching loofah 2.2.0
Installing loofah 2.2.0
Fetching rails-html-sanitizer 1.0.3
Installing rails-html-sanitizer 1.0.3
Fetching actionview 4.2.4
Installing actionview 4.2.4
Fetching rack 1.6.9
Installing rack 1.6.9
Fetching rack-test 0.6.3
Installing rack-test 0.6.3
Fetching actionpack 4.2.4
Installing actionpack 4.2.4
Fetching globalid 0.4.1
Installing globalid 0.4.1
Fetching activejob 4.2.4
Installing activejob 4.2.4
Fetching mini_mime 1.0.0
Installing mini_mime 1.0.0
Fetching mail 2.7.0
Installing mail 2.7.0
Fetching actionmailer 4.2.4
Installing actionmailer 4.2.4
Fetching activemodel 4.2.4
Installing activemodel 4.2.4
Fetching arel 6.0.4
Installing arel 6.0.4
Fetching activerecord 4.2.4
Installing activerecord 4.2.4
Fetching bcrypt 3.1.11
Installing bcrypt 3.1.11 with native extensions
Fetching debug_inspector 0.0.3
Installing debug_inspector 0.0.3 with native extensions
Fetching binding_of_caller 0.8.0
Installing binding_of_caller 0.8.0 with native extensions
Using bundler 1.16.4
Fetching byebug 10.0.0
Installing byebug 10.0.0 with native extensions
Fetching mime-types-data 3.2016.0521
Installing mime-types-data 3.2016.0521
Fetching mime-types 3.1
Installing mime-types 3.1
Fetching carrierwave 1.2.2
Installing carrierwave 1.2.2
Fetching coffee-script-source 1.12.2
Installing coffee-script-source 1.12.2
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching coffee-script 2.4.1
Installing coffee-script 2.4.1
Using thor 0.20.0
Fetching railties 4.2.4
Installing railties 4.2.4
Fetching coffee-rails 4.1.1
Installing coffee-rails 4.1.1
Fetching orm_adapter 0.5.0
Installing orm_adapter 0.5.0
Fetching responders 2.4.0
Installing responders 2.4.0
Fetching warden 1.2.7
Installing warden 1.2.7
Fetching devise 4.4.1
Installing devise 4.4.1
Fetching ffi 1.9.23
Installing ffi 1.9.23 with native extensions
Fetching figaro 1.1.1
Installing figaro 1.1.1
Fetching multi_json 1.13.1
Installing multi_json 1.13.1
Fetching jbuilder 2.7.0
Installing jbuilder 2.7.0
Fetching jquery-rails 4.3.1
Installing jquery-rails 4.3.1
Fetching mini_magick 4.8.0
Installing mini_magick 4.8.0
Fetching sprockets 3.7.1
Installing sprockets 3.7.1
Fetching sprockets-rails 3.2.1
Installing sprockets-rails 3.2.1
Fetching rails 4.2.4
Installing rails 4.2.4
Fetching rb-fsevent 0.10.2
Installing rb-fsevent 0.10.2
Fetching rb-inotify 0.9.10
Installing rb-inotify 0.9.10
Fetching rdoc 4.3.0
Installing rdoc 4.3.0
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching sass 3.5.5
Installing sass 3.5.5
Fetching tilt 2.0.8
Installing tilt 2.0.8
Fetching sass-rails 5.0.7
Installing sass-rails 5.0.7
Fetching sdoc 0.4.2
Installing sdoc 0.4.2
Fetching spring 2.0.2
Installing spring 2.0.2
Fetching sqlite3 1.3.13
Installing sqlite3 1.3.13 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

Bingo…….. funciona todo pero peta en la sqlite…. ¿Porqué? SIMPLE, me olvidé de instalar el RPM de sqlite….

yum install sqlite-devel

[dondebailas@gestion Ruby]$ scl enable ea-ruby24 'bundle install'
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.3.0
Using concurrent-ruby 1.0.5
Using i18n 0.9.5
Using json 1.8.6
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 4.2.4
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.3.0
Using nokogiri 1.8.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.9
Using crass 1.0.3
Using loofah 2.2.0
Using rails-html-sanitizer 1.0.3
Using actionview 4.2.4
Using rack 1.6.9
Using rack-test 0.6.3
Using actionpack 4.2.4
Using globalid 0.4.1
Using activejob 4.2.4
Using mini_mime 1.0.0
Using mail 2.7.0
Using actionmailer 4.2.4
Using activemodel 4.2.4
Using arel 6.0.4
Using activerecord 4.2.4
Using bcrypt 3.1.11
Using debug_inspector 0.0.3
Using binding_of_caller 0.8.0
Using bundler 1.16.4
Using byebug 10.0.0
Using mime-types-data 3.2016.0521
Using mime-types 3.1
Using carrierwave 1.2.2
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using thor 0.20.0
Using railties 4.2.4
Using coffee-rails 4.1.1
Using orm_adapter 0.5.0
Using responders 2.4.0
Using warden 1.2.7
Using devise 4.4.1
Using ffi 1.9.23
Using figaro 1.1.1
Using multi_json 1.13.1
Using jbuilder 2.7.0
Using jquery-rails 4.3.1
Fetching libv8 3.16.14.19 (x86_64-linux)
Installing libv8 3.16.14.19 (x86_64-linux)
Using mini_magick 4.8.0
Using sprockets 3.7.1
Using sprockets-rails 3.2.1
Using rails 4.2.4
Using rb-fsevent 0.10.2
Using rb-inotify 0.9.10
Using rdoc 4.3.0
Fetching ref 2.0.0
Installing ref 2.0.0
Using sass-listen 4.0.0
Using sass 3.5.5
Using tilt 2.0.8
Using sass-rails 5.0.7
Using sdoc 0.4.2
Using spring 2.0.2
Using sqlite3 1.3.13
Fetching therubyracer 0.12.3
Installing therubyracer 0.12.3 with native extensions
Using turbolinks-source 5.1.0
Using turbolinks 5.1.0
Using uglifier 4.1.6
Using web-console 2.3.0
Bundle complete! 17 Gemfile dependencies, 73 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

 

¡¡Tachaaaaaaaaaaaaaaaaaan!!! Todas las gemas instaladas…. ahora sólo queda hacer el db:migrate y rezar a todos los dioses que existen para que funcione….

 

[dondebailas@gestion Ruby]$ scl enable ea-ruby24 ‘bin/rake db:migrate RAILS_ENV=development’

 

Lleva un buen rato, si antes del siglo que viene termina, os aviso 😉

 

 

Nada ,no fué suficiente, seguía petando… ¿Porqué? Pues por la versión de Rails….

[dondebailas@gestion Ruby]$ rm Gemfile.lock 

[dondebailas@gestion ~]$ rm -rf .gem/

[dondebailas@gestion Ruby]$ scl enable ea-ruby24 'bundle install'

Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies......
Using rake 12.3.1
Fetching concurrent-ruby 1.0.5
Installing concurrent-ruby 1.0.5
Fetching i18n 0.9.5
Installing i18n 0.9.5
Fetching minitest 5.11.3
Installing minitest 5.11.3
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching tzinfo 1.2.5
Installing tzinfo 1.2.5
Fetching activesupport 4.2.8
Installing activesupport 4.2.8
Fetching builder 3.2.3
Installing builder 3.2.3
Fetching erubis 2.7.0
Installing erubis 2.7.0
Fetching mini_portile2 2.3.0
Installing mini_portile2 2.3.0
Fetching nokogiri 1.8.4
Installing nokogiri 1.8.4 with native extensions
Fetching rails-deprecated_sanitizer 1.0.3
Installing rails-deprecated_sanitizer 1.0.3
Fetching rails-dom-testing 1.0.9
Installing rails-dom-testing 1.0.9
Fetching crass 1.0.4
Installing crass 1.0.4
Fetching loofah 2.2.2
Installing loofah 2.2.2
Fetching rails-html-sanitizer 1.0.4
Installing rails-html-sanitizer 1.0.4
Fetching actionview 4.2.8
Installing actionview 4.2.8
Fetching rack 1.6.10
Installing rack 1.6.10
Fetching rack-test 0.6.3
Installing rack-test 0.6.3
Fetching actionpack 4.2.8
Installing actionpack 4.2.8
Fetching globalid 0.4.1
Installing globalid 0.4.1
Fetching activejob 4.2.8
Installing activejob 4.2.8
Fetching mini_mime 1.0.1
Installing mini_mime 1.0.1
Fetching mail 2.7.0
Installing mail 2.7.0
Fetching actionmailer 4.2.8
Installing actionmailer 4.2.8
Fetching activemodel 4.2.8
Installing activemodel 4.2.8
Fetching arel 6.0.4
Installing arel 6.0.4
Fetching activerecord 4.2.8
Installing activerecord 4.2.8
Fetching bcrypt 3.1.12
Installing bcrypt 3.1.12 with native extensions
Fetching debug_inspector 0.0.3
Installing debug_inspector 0.0.3 with native extensions
Fetching binding_of_caller 0.8.0
Installing binding_of_caller 0.8.0 with native extensions
Using bundler 1.16.4
Fetching byebug 10.0.2
Installing byebug 10.0.2 with native extensions
Fetching mime-types-data 3.2018.0812
Installing mime-types-data 3.2018.0812
Fetching mime-types 3.2.2
Installing mime-types 3.2.2
Fetching carrierwave 1.2.3
Installing carrierwave 1.2.3
Fetching coffee-script-source 1.12.2
Installing coffee-script-source 1.12.2
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching coffee-script 2.4.1
Installing coffee-script 2.4.1
Using thor 0.20.0
Fetching railties 4.2.8
Installing railties 4.2.8
Fetching coffee-rails 4.1.1
Installing coffee-rails 4.1.1
Fetching orm_adapter 0.5.0
Installing orm_adapter 0.5.0
Fetching responders 2.4.0
Installing responders 2.4.0
Fetching warden 1.2.7
Installing warden 1.2.7
Fetching devise 4.5.0
Installing devise 4.5.0
Fetching ffi 1.9.25
Installing ffi 1.9.25 with native extensions
Fetching figaro 1.1.1
Installing figaro 1.1.1
Fetching multi_json 1.13.1
Installing multi_json 1.13.1
Fetching jbuilder 2.7.0
Installing jbuilder 2.7.0
Fetching jquery-rails 4.3.3
Installing jquery-rails 4.3.3
Fetching json 1.8.6
Installing json 1.8.6 with native extensions
Fetching libv8 3.16.14.19 (x86_64-linux)
Installing libv8 3.16.14.19 (x86_64-linux)
Fetching mini_magick 4.8.0
Installing mini_magick 4.8.0
Fetching sprockets 3.7.2
Installing sprockets 3.7.2
Fetching sprockets-rails 3.2.1
Installing sprockets-rails 3.2.1
Fetching rails 4.2.8
Installing rails 4.2.8
Fetching rb-fsevent 0.10.3
Installing rb-fsevent 0.10.3
Fetching rb-inotify 0.9.10
Installing rb-inotify 0.9.10
Fetching rdoc 4.3.0
Installing rdoc 4.3.0
Fetching ref 2.0.0
Installing ref 2.0.0
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching sass 3.5.7
Installing sass 3.5.7
Fetching tilt 2.0.8
Installing tilt 2.0.8
Fetching sass-rails 5.0.7
Installing sass-rails 5.0.7
Fetching sdoc 0.4.2
Installing sdoc 0.4.2
Fetching spring 2.0.2
Installing spring 2.0.2
Fetching sqlite3 1.3.13
Installing sqlite3 1.3.13 with native extensions
Fetching therubyracer 0.12.3
Installing therubyracer 0.12.3 with native extensions
Fetching turbolinks-source 5.2.0
Installing turbolinks-source 5.2.0
Fetching turbolinks 5.2.0
Installing turbolinks 5.2.0
Fetching uglifier 4.1.18
Installing uglifier 4.1.18
Fetching web-console 2.3.0
Installing web-console 2.3.0
Bundle complete! 17 Gemfile dependencies, 73 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

 

Y …. ¡funcionó!

Doy por terminada la experiencia de dolor de cabeza con Rails en cPanel.

También te puede interesar...

Artículos populares

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.