[plug] Syntax in GemFile for using mariadb with Ruby on rails - Ubuntu 18.04.4

Byron Hammond byronester at gmail.com
Tue Mar 31 13:09:41 AWST 2020


I haven't used Ruby on Rails in a while, so I'll be basic with my
instructions...

The Gemfile contains the list of dependencies your Ruby application needs
to install.
The postgres database driver will be in there, but you want to find what
the mysql driver is and put it in it's place.
After doing that the `bundle install` will install all those dependencies.
Bear in mind that you will probably need to install mysql header files
before all this as the mysql driver is a compiled C extension.

Once you've successfully installed the mysql driver into your rails app,
you want to configure the app to use the mysql database.
Something like `./config/database.yml` will contain the relevant settings.

Now the rails app is configured to talk to the database and has a driver to
do so.
You need to create the database schema/tables, users, etc.

I think that's about it, but like I said, it's been a while.

p.s. Maria came from MySQL and are very similar.

On Tue, 31 Mar 2020 at 12:49, Chris Caston <chris at caston.id.au> wrote:

> Sorry for replying to my own message.
>
> My dad suggested that the GemFile would contain the entry from the MetPlus
> project github. I checked it and it does have an entry gem 'pg' but I
> believe that is for Postgres not mariadb as I require.
>
> On Tue, Mar 31, 2020 at 12:18 PM Chris Caston <chris at caston.id.au> wrote:
>
>> Hello,
>>
>> The VM I am using is running (Ubuntu 18.04.4)
>>
>> I am attempting to install Metplus (
>> https://github.com/AgileVentures/MetPlus_PETS) which uses Ruby v2.3.3
>> and Rail v4.2.3.
>>
>> The install guide (
>> https://www.howtoforge.com/tutorial/ubuntu-ruby-on-rails/) I was using
>> was for Postgresql but I already have mariadb on this machine and would
>> prefer the simplicity using the same database for both.
>> I have (apt-get) installed ruby-mysql2 v0.4.10-0ubuntu5 although I'm
>> happy to change this if I need a newer version.
>>
>> I was also using yet another guide (
>> https://www.botreetechnologies.com/blog/how-to-install-mariadb-on-ubuntu-14-04-lts-and-connect-ruby-on-rails
>> ) but it is for an old version of Ubuntu and it wasn't clear on the
>> exact entry I needed to make.
>>
>> I need to add a line to my Gems file now and run "bundle install" to
>> continue to the next step.
>>
>> I'm unsure exactly what this needs to be.
>>
>> Any assistance would be appreciated. Please let me know if you need more
>> information.
>>
>> best regards,
>>
>> Christopher Caston
>>
>> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://lists.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.org.au
> PLUG Membership: http://www.plug.org.au/membership
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20200331/81009942/attachment.html>


More information about the plug mailing list