macOS Big Sur: RVM error running ‘__rvm_make -j4’

If you are runnig into issues installing RVM and Ruby on macOS Big Sur and you get the following “error running ‘__rvm_make -j4′”. Here is a solution to get Ruby installed under RVM.

brew install homebrew/portable-ruby/portable-openssl
rvm reinstall ruby-2.3.1 --with-openssl-dir=/usr/local/opt/portable-openssl/

I have not spent time diving into the root cause of the error, just glad someone had a solution to the problem. Here is the original Github issue report that had a solution that worked: https://github.com/rvm/rvm/issues/4484.

Ubuntu + Rmagick + Gem

 

If you run into trouble installing Rmagick on Ubuntu, it is most likely because you do not have the dev libraries installed that are needed by the rmagick Ruby Gem. Run the following commands in your terminal and everything should work fine.

sudo apt-get install graphicsmagick-libmagick-dev-compat
sudo apt-get install imagemagick
sudo apt-get install libmagickcore-dev
sudo apt-get install libmagickwand-dev
gem install rmagick

Ubuntu + RVM: Ruby Install – There was an error(23)

After a new install of RVM on Ubuntu, you may run into the error “There was an error(23)” in conjunction with a file write or folder creation permission error. This is caused when, for some reason, RVM does not properly add your Ubuntu user to the RVM group after it was installed. To correct this error, you need to complete the following steps, and executing the following commands:

Execute in terminal:
rvm group add rvm "$USER"

Log out of Ubuntu and log back in. If it still fails, you may need to have RVM fix its system permissions with the command:

Execute in terminal:
rvm fix-permissions

Rails 4: Set Application-Wide Date/DateTime/Time Display Format

If you are like me, you want the all dates and times to display throughout your application using the same format. This can be accomplished through the following procedure.

Create a new Rails ‘Initializer’ file in your application’s ‘/config/initializers’ directory titled ‘date_format.rb’ and then paste into that file the following Ruby script. Simply uncomment the format you wish to use for each of the types Date, DateTime, and Time.

# Date
# —————————-
#Date::DATE_FORMATS[:default] = “%Y-%m-%d” # 2013-11-03
#Date::DATE_FORMATS[:default] = “%B %e, %Y” # November 3, 2013
#Date::DATE_FORMATS[:default] = “%e %b %Y” # 3 Nov 2013
#Date::DATE_FORMATS[:default] = “%Y%m%d” # 20131103
#Date::DATE_FORMATS[:default] = “%e %b” # 3 Nov

# DateTime
# —————————-
#DateTime::DATE_FORMATS[:default] = “%Y-%m-%d” # 2013-11-03 14:22:18
#DateTime::DATE_FORMATS[:default] = “%B %e, %Y” # November 3, 2013 14:22
#DateTime::DATE_FORMATS[:default] = “%e %b %Y” # Sun, 3 Nov 2013 14:22:18 -0700
#DateTime::DATE_FORMATS[:default] = “%Y%m%d” # 20131103142218
#DateTime::DATE_FORMATS[:default] = “%e %b” # 3 Nov 14:22

# Time
# —————————-
#Time::DATE_FORMATS[:default] = “%Y-%m-%d %H:%M:%S” # 2013-11-03 14:22:18
#Time::DATE_FORMATS[:default] = “%B %d, %Y %H:%M” # November 3, 2013 14:22
#Time::DATE_FORMATS[:default] = “%a, %d %b %Y %H:%M:%S %z” # Sun, 3 Nov 2013 14:22:18 -0700
#Time::DATE_FORMATS[:default] = “%d %b %H:%M” # 3 Nov 14:22
#Time::DATE_FORMATS[:default] = “%Y%m%d%H%M%S” # 20131103142218
#Time::DATE_FORMATS[:default] = “%H:%M” # 14:22

Rails 4: gem install pg (when using the Postgresql App on OS X)

If you are getting a build error from Gem when trying to install the PostgreSQL gem called ‘pg’ and you are using the PostgreSQL App instead of installing PostgreSQL via Brew or some other method, it is because Gem cannot find the PostgreSQL config in the standard locations. To correct this you need to provide Gem with the path to the config file stored within the PostgreSQL App’s internal folder structure.

This can be done as follows:

gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config

<update: for latest versions of Postgres.app>

gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config

Another way to accomplish this is:

export CONFIGURE_ARGS=”with-pg-include=/Applications/Postgres.app/Contents/Versions/9.4/include/”
gem install pg

Note: the latest version of the PostgreSQL App, at the time of this writing was 9.4, your version may be different. Make sure you change the 9.4 in the config path in the command above to the one you are using or it will not work. You can verify the path by opening Finder, going to the Applications folder, locating Postgres.app, right clicking and selecting ‘show package contents’. This will open up the app’s folder structure in Finder.

Mint 14: Latest Gedit Version + Ruby Plugins

If you are trying to use new plugins for Gedit, the default text editor on Mint, you might run into a problem as a lot of the new plugins require Gedit >=3.0 and be default Mint comes with 2.30.

To fix this you need to first get rid of Gedit 2.30 completely by running the following commands in your terminal.

sudo apt-get purge gedit
sudo apt-get purge gedit-common

Once those commands have completed successfully you need to run these commands to get the 3.6.1 version.





sudo apt-get install gedit-common/quantal
sudo apt-get install gedit/quantal

Now that we have the correct Gedit version we can install the Ruby and Rails plugins for Gedit. That’s all there is to it!

$ sudo apt-add-repository ppa:ubuntu-on-rails/ppa
$ sudo apt-get update
$ sudo apt-get install gedit-gmate

$ sudo apt-get install gedit-plugins