Creating a ruby-2.2 on Openshift - ruby-on-rails-4

Was anyone able to create a Diy cartridge in OpenShift with Ruby 2.2?
If so can you share with us how? Or if there is any plans on having Ruby 2.2 as a default cartridge?
Thanks

Openshift3 changed the way they build cartages, they build cartages from docker images now.
Here is how you can build ruby-2.2 deployment environment:
https://blog.openshift.com/deploying-ruby-applications-on-openshift-3/

Pretty old question provided OpenShift v2 is close to EOL. But I thought to share how I made RAILS 5 app work on v2.
The key points is to:
use the DIY cart
create start/stop/deploy hooks that install ruby 2.3 by rvm, etc.
possibly use alternative gems
But too long to paste all scripts here. It involves a hack or two to make RVM happy. I'd suggest looking at last commit of this branch to see my action-hooks from that commit and possibly borrow from there.
+1 to suggestion to plan on deploying on v3 if possible.

Related

Redmine version 3.0.3 to 4.0.3 upgrade

I'm currently on a task to upgrade from Redmine 3.0.3 to Redmine 4.0.3.
I have followed these steps from http://www.redmine.org/projects/redmine/wiki/redmineupgrade but the current system is running a version of Ruby that is not supported by Redmine 4.0.3. I have also tried to make a new server using Turnkey Redmine and then copied over the database and configuration file, but with no luck.
Has anyone done this before and if so is there an how-to guide somewhere?
This appears to be more of a general 'How to deploy a Rails application' question, not really Redmine specific.
In short, Chruby or the aforementioned Rvm are the answer to all your Ruby version problems. After installing a current version of Ruby, you will have to somehow configure your Ruby server (Unicorn or mod_rails or whatever you're using) to run with that version of Ruby. How to do that really depends on what you are running and, again, is not Redmine specific but specific to that server.

Saleor comes with react by default. Can we have a 'basic' Saleor without frontend frameworks?

I wanted to use Saleor for a "single-type-product" e-commerce website. I installed Saleor yesterday but it has a huge requirements file, including react.js and many other frontend stuff. I don't want them. Is it possible to install Saleor without anything else? Or at least, with the least other requirements?
Yes, you can simply install the backend and expose the graphql api endpoint to consume data from you front-end. Or go regular django-style and use templated views. Simply clone the repo here https://github.com/mirumee/saleor.git, install, migrate and run the django server.
Yes. You can install saleor only the backend part.
To do so,
run git clone https://github.com/mirumee/saleor.git
after that,
create a docker-compose.yml file if you would like to run with docker-compose
otherwise you are good to go.

Using newer version of nodejs in a ruby project with cloud foundary

My project is using the latest ruby-buildpack which currently loads nodejs 6.14.4. I'd like to use a more current version of nodejs. What's the best way to get it exposed to the application? Does multi-buildpacks solve this problem, and if so, do I list the nodejs buildpack before or after the ruby buildpack in the manifest file? Or, would it be better to package a custom buildpack?
What's the best way to get it exposed to the application? Does multi-buildpacks solve this problem,
I think multi-buildpacks should work for you. You can put Nodejs as a supply buildpack which would tell it to install Node.js, whatever version you want. Then the Ruby buildpack would run and Node.js should be available on the path while it runs so you can use it to do whatever you want.
and if so, do I list the nodejs buildpack before or after the ruby buildpack in the manifest file
The last buildpack should be the buildpack which supplies the command to start your app. Only the final buildpack is allowed to pick the command which starts your app. Other buildpacks, called supply buildpacks, only contribute/install dependencies.
It sounds like that should be the Ruby buildpack in your case.
Or, would it be better to package a custom buildpack?
I'd strongly advise against this. Forking and maintaining a buildpack is a lot of work. Let other people do this work for you and you'll be a lot happier :)

How to replace phpoffice/phpexcel with phpoffice/phpspreadsheet

Main error when doing composer install:
Package phpoffice/phpexcel is abandoned, you should avoid using it.
Use phpoffice/phpspreadsheet instead.
I am using "maatwebsite/excel": "~2.1.0"
And Laravel 5.5
I wanna avoid migrating excel to 3.0. I already tried migrating it but it doesn't fit in.
You can try out the following guide, or the mentioned "Automated tool"
Migration from PHPExcel
In the meantime, you can specify the complete version number of Excel to continue running updates.
Discalimer: I wrote a tool that handles automated migration from CLI called Rector, so people don't have to upgrade PHP code manually anymore. It's free, open-source, on GitHub.
Official "Automated tool" only fixes class names. There are 24 more cases, that needs to be changed. We need to upgrade huge PHP project and manual changes would take too much time and could stuck us for weeks.
Instead I made an upgrade set with all 25 cases, that changed code for us:
composer require rector/rector --dev
vendor/bin/rector process src --set phpexcel-to-phpspreadsheet
Do you want to know more? Check How to Migrate From PHPExcel to PHPSpreadsheet with Rector in 30 minutes post

Capistrano for Django

Does anyone know of a good Django equivalent of Capistrano/Webistrano?
Fabric is a Python-based application deployment system. It can be used to deploy Django projects.
Capistrano (and therefore Webistrano) can be used for pretty much any deployment, so long as you use SSH. Capistrano is Rails-ready out-of-the-box but it can easily be configured to deploy PHP, Django, Java...whatever really.
Capistrano is a Ruby application so you'll need to have Ruby (and the required Gems) installed to run it.
Webistrano is a Rails application and you can run this locally or deploy it to a server if you wish.
I googled around for a simple formula, and then created my own at: http://www.sandelman.ca/mcr/blog/ruby-on-rails/deploying_django_applications_with_capistrano/