How to use ruby 2.7 on my Ruby on Rails applications - amazon-ec2

I updating my applications that are running in AWS OpsWorks so I need to use Ruby 2.7, but the newest version showing is 2.6.
Can I force my stack to use 2.7 version?

According to this page: https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-ruby.html
Version 2.7 is not yet available for OpsWorks.

Related

Can we install C gems in ruby 2.7.0

I just upgraded by ruby to 2.7.0.
And I tried to install the ibm_db gem in windows platform. Installation works fine. When I try to use the gem(like require 'ibm_db') I get the following error
LoadError (126: The specified module could not be found. - C:/Ruby27/lib/ruby/gems/2.7.0/gems/ibm_db-5.1.0-x86-mingw32/lib/mswin32/rb2x/i386/ibm_db.so)
I have faced this type of error in ruby 2.6 also but when I have set RUBY_DLL_PATH to the ddl which the gem uses it is solved.
But in ruby 2.7 even after setting this variable I get the following error.
Can anyone please help in solving this? ( I have one more doubt:- c gems are supported in ruby 2.7)
It appears that the ibm_db gem currently does not support Ruby 2.7 yet. The newest Ruby version they support is Ruby 2.6.x.
There is a pull request at https://github.com/ibmdb/ruby-ibmdb/pull/105 which might add support for Ruby 2.7 though.
The issue is because the binary was pointed to ruby 2.6 binary. So replace it with the latest ruby 2.7 binary and then everything works fine.
Thanks,
Akhil

Cookbook's deep dependency requires an unavailable Ruby version. How to circumvent via chef for Amazon Linux?

I'm a non-Ruby developer using Chef 11.10 on Amazon Linux AMI 2018.03, OpsWorks Agent v.3451.
My Route53 cookbook requires fog which requires fog-brightbox which requires an unspecified version of dry-inflector whose most recent version requires Ruby version 2.4 in its gemspec.
fog is installed via chef_gem which uses a separate version of Ruby reserved for use by the Chef client only, and it is not recommended to update this Ruby version as it may disable the Opsworks Agent.
Is the only way to get around this issue to fork and host each dependency in the chain, then force an earlier version of the deep dependency?
Version 0.1.2 of the dry-inflector gem doesn't require a specific version of Ruby.
Just install the gem with that specific version as soon as possible on your machine.

How to handle different ruby version requirements between chef 10.28.0 and ohai 8.0.1

I'm trying to build a server on rackspace using chef 10.28.0, building the exact same configuration that I've built three times before without any changes. The only difference is that chef installed ohai 7.4.0 on the previous runs and this time it is installing ohai 8.0.1.
The problem is that chef 10.28.0 installs ruby 1.9.3, whereas ohai 8.0.1 requires ruby 2.0.0 or greater. From my googling I have found that chef 10 supports ruby 2.0 but installs ruby 1.9 by default. Is there any way to get chef 10 to install ruby 2.0 instead? Barring that, is there any way to get chef 10 to install ohai 7.4 instead of 8.0?
Thanks in advance.
Please use the omnibus installer packages. These include Ruby, Chef, Ohai, and all the other dependencies in a working configuration. You can download older versions of the omnibus installers from the download page:
Or you can use the -v option to the bootstrap scripts.
The answer was in the bootstrap scripts. We are using custom bootstrap scripts and the versions for ruby, chef and ohai are all in there.

Ruby version for Chef

Can Chef support newer versions of Ruby i.e. 2.0.0?
If not , is there a reason why?
In the documentation it specified up to 1.9.2
https://wiki.opscode.com/display/chef/System+Requirements+with+install (dead link)
Chef 11.6+ supports Ruby 2.0. Versions less than that will only work on Ruby 1.8 and 1.9.
Sources:
I work for Opscode
I use Chef on Ruby 2.0, 1.9, and 1.8
Documentation might need some updating. Chef supports ruby 2.0 according to this blogpost
http://www.opscode.com/blog/2013/09/03/chef-10-28-0-released/
Find the latest requirements at https://docs.chef.io/chef_system_requirements.html
Currently, Ruby 2.2.2 (or higher)

Upgrading Ruby to 1.9

I have ruby v 1.8 installed at C:\Ruby and its gems underneath.
I am planning to upgrade to v 1.9 , and it's installer try to default the app to c:\Ruby 1.9
How shall i proceed in order not to break my old gems .. including Rails , etc?
Thanks
Using the RubyInstaller, can I install Ruby 1.8 and 1.9 at the same time?
A: Yes. By using the RubyInstaller, Ruby 1.8 will be installed by default
to C:\Ruby, while 1.9 will be installed to C:\Ruby19. This is by design as
Ruby 1.8 and 1.9 offer a different API that may interfere with some RubyGems.
Source: http://wiki.github.com/oneclick/rubyinstaller/faq#dual_install
So go ahead and use the default of installing to C:\Ruby19.

Resources