Heroku: upgrading Ruby application from Cedar-14 to Heroku-18 - ruby

I am working on upgrading the heroku stack of my Ruby application from Cedar-14 to Heroku-18. The Ruby version of my application is 2.0.0 however the Heroku-18 stack is based on Ubuntu 18.04 requires a higher version of Ruby. As my application uses an older version, upgrading is complex and time consuming.
With that said,
Can I still be able to run with the same older versions of Ruby, Ruby Gems and Rails on Heroku-18 stack at my own RISK? As I am still be able to run my application locally on Ubuntu 18.04
Does heroku supports SSH to servers for installation of older versions and related plugins like AWS?

Related

Why does the gem mysql2 fails to install when i try to install a version 0.3.x but successfully installs the version 0.4.x and above?

I am new to ruby on rails and am trying to run an older project using gem mysql2 0.3.21. I cant change the gem version. I have already used "sudo apt-get install libmysqlclient-dev" command and the error is still there.
Also when i use the command "sudo apt install libmariadb-dev" the bundle is installed but the rake db:create gives error.
The ruby mysql client is infamously known to be very picky on which dynamic libraries you have installed in your system. So if your local mysql (even just the shared client dev package) is not 100% compatible with the expectations of the gem version, you will not be able to compile it.
I have personally had to switch between 0.3.15 and 0.3.21 because the mysql version in ubuntu (my machine) was only compatible with gem 0.3.21 and above (being MySQL 5.7), while the one on MacOS (the rest of the team) only with 0.3.15 (it was MySQL 5.5).
To make your gem compile you need to have MySQL 5.7 dev packages, and not 8.0+. Once it's compiled, you can switch back to the current version (or even better, start the compatible version in a docker container).

How to upgrade ruby version in Amazon Linux system?

I have developed ruby application using padrino ruby framework.
And I would like to deploy it on Amazon.
I used this image.
Amazon Linux AMI 2017.09.1 (HVM), SSD Volume Type
And image description was:
"The Amazon Linux AMI is an EBS-backed, AWS-supported image. The default image includes AWS command line tools, Python, Ruby, Perl, and Java. The repositories include Docker, PHP, MySQL, PostgreSQL, and other packages."
After launching instance, I tested ruby version and it was ruby 2.0.0p648 (2015-12-16) [x86_64-linux] but I need ruby2.4 to deploy padrino framework.
I tried to update ruby version with no success for whole day.
console says current version is latest version and there is no ruby2.4
How to solve this?(I updated gem version to 2.7.2)
If you are running Amazon Linux 2, later versions of popular software packages (including Ruby) are installed using the Extras Library. To see the latest available version:
$ amazon-linux-extras list
You'll need sudo privileges to install:
$ sudo amazon-linux-extras install ruby2.6
To install ruby 2.4 do this, sudo yum install -y ruby24.
And to make 2.4 the default version (the old version will still be there) do this, sudo alternatives --set ruby /usr/bin/ruby2.4.

(Rails app deployment) capistrano bundles with invalid ruby version

I have Digital Ocean ubuntu droplet, I have installed RVM and set ruby version to 2.1.1
On server:
> env
RUBY_VERSION=ruby-2.1.1
ruby -v in my project: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
I've tried to deploy app with capistrano, but it failed, because of bundler
command cap production deploy creates
/home/deploy/app_name/shared/bundle/ruby/2.3.0
Where can I set a valid bundle ruby version? Why cap production deploy creates 2.3.0 v. directory?
I believe this can happen because you have system-wide ruby 2.3.0, and capistrano uses it by default.
You can give a try to https://github.com/capistrano/rvm or some related, more up to date gem, that provides rvm integration with capistrano.
I had a similar issue and it was like Stanislav said, it's a problem with the rvm system-wide installation. I'm sure that you have installed the Ruby on Rails One click Application. In order to solve it I created a new clean Ubuntu Droplet, and installed rvm single-user manually.

Fluentd influxdb installation Error?

I want to install influxdb plugin but I get thid error.
ERROR: Error installing fluent-plugin-influxdb:
influxdb requires Ruby version >= 2.2.0.
I uninstalled my ruby and installed different versions from 2.0.0, 2.2.0, 2.3, 2.4
but the error still exist. would you please help me how to solve this.
Thank you.
First of all I installed latest version of ruby from hereruby ftp
Then I installed influxdb client
apt-get install influxdb-dev influxdb-client.
After all downlad the latest version of fluend-plugin-influxdb from git hub of plugin
then I installed the plug in
/opt/td-agent/embedded/bin/gem install fluent-plugin-influxdb
td-agent (Treasure Data's packaged version of Fluentd) includes its own version of ruby within the /opt/td-agent/embedded/ directory and has links to ensure that it does not collide with other installations of ruby on the same box.
You can update to the latest version of td-agent, or if you need a specific version of Ruby then you should
Install Ruby version
Follow gem install instructions here: https://docs.fluentd.org/v0.12/articles/install-by-gem

Trouble running RubyGems on Redhat 5.5

Am trying to install Ruby and RubyGems on a RedHat 5.5 machine. I'd got them by running the following two commands:
sudo yum install ruby
sudo yum install rubygems
Got both installed. However when i try to run gem, i got the following error:
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require': undefined methodend_with?' for "no such file to load --
Win32API":String (NoMethodError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:55
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:inrequire'
from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:8
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:inrequire'
from /usr/bin/gem:9
Doesn't matter what kind of command i run, it throws that. (I tried gem -v, gem update)
The version of Ruby seems to be 1.8 but i have problem determining the RubyGems version. I'd vi into rubygems.rb and at the top it stats the version as 1.5.
Try to fix by running the downgrade command as proposed here, but it throws the same error as well.
Any help on fixing this issue? Just want to get this running so that i can run a RoR apps..
RedHat 5 ships with Ruby 1.8.5 and an equally old rubygems. Both, the rubygems and the ruby version is WAY too old to be supported by anything outside the base packages of the OS anymore. Even in the OS packages, they probably won't change anything on their own due to the age of their whole system.
If you really want/have to use Ruby on Red Hat 5, you probably need to get another source for it that the RPMs provided by the OS, e.g. rbenv / ruby-build or ruby-install or even rvm. You should use a newer Ruby version, i.e. a 2.1 or 2.2 version. All Ruby versions < 2.0 are unsupported by the language developers by now.
Alternatively, you should try to use a newer version of RedHat, i.e. RedHat 7 which doesn't need to support to 8 year old software...
Suspicious here is that yum installed ruby 1.8 which is pretty outdated version, it seems you have two versions of ruby on your system now and gem tries to use the old one.
Check the version of the package installed recently and try to force rubygems to use the new version(by removing the old ruby or linking to the path returned by which ruby)

Resources