New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 2.4.0 #403

Open
voxxit opened this Issue Dec 30, 2016 · 29 comments

Comments

Projects
None yet
@voxxit

voxxit commented Dec 30, 2016

Ruby 2.4.0 (patchlevel 0) was released on 2016-12-25. Just curious when we can expect to see it added to Chef 11?

Something tells me this should be automated, at least as a beta/opt-in feature... :-)

@githuesch githuesch referenced this issue Jan 5, 2017

Open

Ruby 2.3.0 #358

@jstockdale

This comment has been minimized.

Show comment
Hide comment
@jstockdale

jstockdale Jan 6, 2017

+1 Sure. Why not. (Despite all appearances that AWS has abandoned support for OpsWorks improvements on the old stack.)

jstockdale commented Jan 6, 2017

+1 Sure. Why not. (Despite all appearances that AWS has abandoned support for OpsWorks improvements on the old stack.)

@interpegasus

This comment has been minimized.

Show comment
Hide comment
@interpegasus

interpegasus Feb 2, 2017

Hi, I would like to know if it is possible to have apps that use different Ruby versions in the same stack.

I would like to deploy two apps. One uses Ruby 2.1.8 and the other one Ruby 2.4.0

Thanks.

interpegasus commented Feb 2, 2017

Hi, I would like to know if it is possible to have apps that use different Ruby versions in the same stack.

I would like to deploy two apps. One uses Ruby 2.1.8 and the other one Ruby 2.4.0

Thanks.

@githuesch

This comment has been minimized.

Show comment
Hide comment
@githuesch

githuesch Feb 2, 2017

Contributor

@interpegasus I don't see a clean way to pull that off. The Ruby version is a setting on a layer, and there's no way to override that per app. To be honest, I don't even see a dirty way to pull that off.

Contributor

githuesch commented Feb 2, 2017

@interpegasus I don't see a clean way to pull that off. The Ruby version is a setting on a layer, and there's no way to override that per app. To be honest, I don't even see a dirty way to pull that off.

@interpegasus

This comment has been minimized.

Show comment
Hide comment
@interpegasus

interpegasus Feb 2, 2017

@githuesch Thanks for the fast reply.
I will switch the apps and layer, to the latest supported ruby version 2.3. While 2.4 support is implemented.

http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-ruby.html

interpegasus commented Feb 2, 2017

@githuesch Thanks for the fast reply.
I will switch the apps and layer, to the latest supported ruby version 2.3. While 2.4 support is implemented.

http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-ruby.html

@voxxit

This comment has been minimized.

Show comment
Hide comment
@voxxit

voxxit Mar 12, 2017

@githuesch Any word on this? How can the community help out with this going forward to ensure we're not lagging behind :)

voxxit commented Mar 12, 2017

@githuesch Any word on this? How can the community help out with this going forward to ensure we're not lagging behind :)

@githuesch

This comment has been minimized.

Show comment
Hide comment
@githuesch

githuesch Mar 13, 2017

Contributor

@voxxit The only thing the community can really do is to express the need for Ruby 2.4 with +1's in this thread. This helps us prioritize this task against others.

Contributor

githuesch commented Mar 13, 2017

@voxxit The only thing the community can really do is to express the need for Ruby 2.4 with +1's in this thread. This helps us prioritize this task against others.

@inket

This comment has been minimized.

Show comment
Hide comment
@inket

inket Apr 14, 2017

Well, this is a +1 with a bump.

inket commented Apr 14, 2017

Well, this is a +1 with a bump.

@inopinatus

This comment has been minimized.

Show comment
Hide comment
@inopinatus

inopinatus Apr 18, 2017

+1 it is then.

inopinatus commented Apr 18, 2017

+1 it is then.

@turboladen

This comment has been minimized.

Show comment
Hide comment
@turboladen

turboladen commented Apr 19, 2017

+1

@IMhide

This comment has been minimized.

Show comment
Hide comment
@IMhide

IMhide commented Apr 24, 2017

+1

@kleberpinel

This comment has been minimized.

Show comment
Hide comment
@kleberpinel

kleberpinel commented Apr 25, 2017

+1

@andrewyoo

This comment has been minimized.

Show comment
Hide comment
@andrewyoo

andrewyoo Apr 30, 2017

+1, just updated my app to run on 2.4.1, but just realized i can't run it on my opsworks setup.

andrewyoo commented Apr 30, 2017

+1, just updated my app to run on 2.4.1, but just realized i can't run it on my opsworks setup.

@jondecko

This comment has been minimized.

Show comment
Hide comment
@jondecko

jondecko commented Jun 30, 2017

+1

@cyrill62

This comment has been minimized.

Show comment
Hide comment
@cyrill62

cyrill62 commented Jul 12, 2017

👍

@timdorr

This comment has been minimized.

Show comment
Hide comment
@timdorr

timdorr Aug 18, 2017

(Note: This is only for Ubuntu 14.04. Other OSes are on your own...)

I was able to get this to work on my own. I had to do a few things.

First, you need a .deb for Ruby 2.4.1. In order to figure this out, I downloaded the Ruby 2.3.4 .deb, extracted it (.debs are .ar files with a control.tar.gz and data.tar.gz inside), and opened up the usr/local/lib/ruby/2.3.0/x86_64-linux/rbconfig.rb file. That contains the exact configure args (CONFIG["configure_args"]) that were used to build Ruby. I used that to build my own copy of 2.4.1 on a x86_64 Ubuntu 14.04 box:

apt-get install gcc autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
wget https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz
tar zxfv ruby-2.4.1.tar.gz
cd ruby-2.4.1/
./configure --prefix=/usr/local --enable-shared --disable-rpath --disable-install-doc
make

I noticed the deb was built with fpm, so I installed that to do my eventual packaging:

apt-get install ruby ruby-dev
gem install --no-ri --no-rdoc fpm

One last thing I needed to duplicate the build was to get the right post-install script. I created a postinstall file with these contents:

#! /usr/bin/env sh
/sbin/ldconfig

OK, so now we're ready to package things up.

make install DESTDIR=/tmp/installdir/
fpm -s dir -t deb -n opsworks-ruby2.4 -v 2.4.1-1 -C /tmp/installdir --after-install=./postinstall

Out pops a opsworks-ruby2.4_2.4.1-1_amd64.deb file for you to use. You can use dpkg -c opsworks-ruby2.4_2.4.1-1_amd64.deb to make sure it's got the right stuff in it. Here's a copy of my build that we're using in production. Use this at your own risk, as I may have messed something up!

https://www.dropbox.com/s/1hjlnj6x0lco0d6/opsworks-ruby2.4_2.4.1-1_amd64.deb?dl=0

To actually use this, you need to get OpsWorks to download from a URL you control. The default URL can be overridden via stack JSON. So, create an S3 bucket and upload the .deb under a packages/ubuntu/14.04/ folder. (Don't forget to make the bucket/files public!) Then add this to your stack JSON:

  "opsworks_commons": {
    "assets_url": "https://my-opsworks-bucket-o-stuff.s3.amazonaws.com"
  },

To ensure you don't break things if you don't update the ruby version right away, you can also place the other .debs that OpsWorks pre-built into that bucket at that path. They're available at https://opsworks-instance-assets.s3.amazonaws.com/packages/ubuntu/14.04/opsworks-ruby2.3_2.3.4-1_amd64.deb and you can adjust the URL to grab ones for other versions of Ruby that you have in use currently.

OK, last part is to get OpsWorks to use this version of Ruby. While they don't have a preset for 2.4, you can configure it yourself. So, add this to your stack JSON:

  "ruby" : {
    "major_version": "2",
    "minor_version": "4",
    "patch_version": "1",
    "pkgrelease": "1",
    "full_version": "2.4",
    "version": "2.4.1"
  },

That will override whatever version you have set for your layer. You should be able to deploy and be on 2.4!

It worked for me, but obviously I can't guarantee success for others. Also, if you have other layer types that depend on other binaries (Node, PHP, etc, and probably MySQL/Memcached too), you'll need to upload those .debs to your bucket as well (since you're overriding the assets_url for the whole stack).

TL;DR I built a custom binary .deb for Ruby 2.4.1, hosted that on an S3 bucket, and configured my stack JSON to use that binary and ruby version.

timdorr commented Aug 18, 2017

(Note: This is only for Ubuntu 14.04. Other OSes are on your own...)

I was able to get this to work on my own. I had to do a few things.

First, you need a .deb for Ruby 2.4.1. In order to figure this out, I downloaded the Ruby 2.3.4 .deb, extracted it (.debs are .ar files with a control.tar.gz and data.tar.gz inside), and opened up the usr/local/lib/ruby/2.3.0/x86_64-linux/rbconfig.rb file. That contains the exact configure args (CONFIG["configure_args"]) that were used to build Ruby. I used that to build my own copy of 2.4.1 on a x86_64 Ubuntu 14.04 box:

apt-get install gcc autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
wget https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz
tar zxfv ruby-2.4.1.tar.gz
cd ruby-2.4.1/
./configure --prefix=/usr/local --enable-shared --disable-rpath --disable-install-doc
make

I noticed the deb was built with fpm, so I installed that to do my eventual packaging:

apt-get install ruby ruby-dev
gem install --no-ri --no-rdoc fpm

One last thing I needed to duplicate the build was to get the right post-install script. I created a postinstall file with these contents:

#! /usr/bin/env sh
/sbin/ldconfig

OK, so now we're ready to package things up.

make install DESTDIR=/tmp/installdir/
fpm -s dir -t deb -n opsworks-ruby2.4 -v 2.4.1-1 -C /tmp/installdir --after-install=./postinstall

Out pops a opsworks-ruby2.4_2.4.1-1_amd64.deb file for you to use. You can use dpkg -c opsworks-ruby2.4_2.4.1-1_amd64.deb to make sure it's got the right stuff in it. Here's a copy of my build that we're using in production. Use this at your own risk, as I may have messed something up!

https://www.dropbox.com/s/1hjlnj6x0lco0d6/opsworks-ruby2.4_2.4.1-1_amd64.deb?dl=0

To actually use this, you need to get OpsWorks to download from a URL you control. The default URL can be overridden via stack JSON. So, create an S3 bucket and upload the .deb under a packages/ubuntu/14.04/ folder. (Don't forget to make the bucket/files public!) Then add this to your stack JSON:

  "opsworks_commons": {
    "assets_url": "https://my-opsworks-bucket-o-stuff.s3.amazonaws.com"
  },

To ensure you don't break things if you don't update the ruby version right away, you can also place the other .debs that OpsWorks pre-built into that bucket at that path. They're available at https://opsworks-instance-assets.s3.amazonaws.com/packages/ubuntu/14.04/opsworks-ruby2.3_2.3.4-1_amd64.deb and you can adjust the URL to grab ones for other versions of Ruby that you have in use currently.

OK, last part is to get OpsWorks to use this version of Ruby. While they don't have a preset for 2.4, you can configure it yourself. So, add this to your stack JSON:

  "ruby" : {
    "major_version": "2",
    "minor_version": "4",
    "patch_version": "1",
    "pkgrelease": "1",
    "full_version": "2.4",
    "version": "2.4.1"
  },

That will override whatever version you have set for your layer. You should be able to deploy and be on 2.4!

It worked for me, but obviously I can't guarantee success for others. Also, if you have other layer types that depend on other binaries (Node, PHP, etc, and probably MySQL/Memcached too), you'll need to upload those .debs to your bucket as well (since you're overriding the assets_url for the whole stack).

TL;DR I built a custom binary .deb for Ruby 2.4.1, hosted that on an S3 bucket, and configured my stack JSON to use that binary and ruby version.

@rohit01

This comment has been minimized.

Show comment
Hide comment
@rohit01

rohit01 Oct 6, 2017

@voxxit The only thing the community can really do is to express the need for Ruby 2.4 with +1's in this thread. This helps us prioritize this task against others.

+1

rohit01 commented Oct 6, 2017

@voxxit The only thing the community can really do is to express the need for Ruby 2.4 with +1's in this thread. This helps us prioritize this task against others.

+1

@aselder

This comment has been minimized.

Show comment
Hide comment
@aselder

aselder commented Oct 16, 2017

+1

@inopinatus

This comment has been minimized.

Show comment
Hide comment
@jamesisaacs

This comment has been minimized.

Show comment
Hide comment
@jamesisaacs

jamesisaacs commented Nov 3, 2017

+1

@AlexGunslinger

This comment has been minimized.

Show comment
Hide comment
@AlexGunslinger

AlexGunslinger commented Jan 24, 2018

+1

@porter77

This comment has been minimized.

Show comment
Hide comment
@porter77

porter77 commented Feb 26, 2018

+1

@xtrombone

This comment has been minimized.

Show comment
Hide comment
@xtrombone

xtrombone commented Mar 7, 2018

+1

@krzkrzkrz

This comment has been minimized.

Show comment
Hide comment
@krzkrzkrz

krzkrzkrz commented Apr 27, 2018

+1

@dw-io

This comment has been minimized.

Show comment
Hide comment
@dw-io

dw-io commented May 25, 2018

+1

@AlexanderUlitin

This comment has been minimized.

Show comment
Hide comment
@AlexanderUlitin

AlexanderUlitin commented Jul 3, 2018

+1

@jamesmacwilliam

This comment has been minimized.

Show comment
Hide comment
@jamesmacwilliam

jamesmacwilliam commented Jul 24, 2018

+1

@archana-juvo

This comment has been minimized.

Show comment
Hide comment
@archana-juvo

archana-juvo commented Aug 20, 2018

+1

@DavidMMelin

This comment has been minimized.

Show comment
Hide comment
@DavidMMelin

DavidMMelin commented Aug 30, 2018

+1

@ritikesh

This comment has been minimized.

Show comment
Hide comment
@ritikesh

ritikesh commented Oct 11, 2018

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment