How do I send logs to mysql using fluentd? - fluentd

I have made one django application and I want to use fluentd to log my API call's, basically I want to send log from django to my SQL database using fluentd.
Here is my code below:
<match **>
#type mysql_bulk
host 127.0.0.1
database masking_tool_db
username root
password
column_names request, response
table fluentd_logs
flush_interval 10s
</match>
But I'm not able to install the plugin.
Here is the error I got:
ERROR: Error installing fluent-plugin-mysql:
The last version of mysql2 (>= 0) to support your Ruby & RubyGems was 0.5.3. Try installing it with `gem install mysql2 -v 0.5.3` and then running the current command again
mysql2 requires Ruby version >= 2.2, < 2.7.dev. The current ruby version is 2.7.1.83.

Related

I can't rails a server when i create a project with mysql

When I create a rails project without using mysql, I can rails server and read in the browser in http://localhost:3000.Also I can create datebase into sqlite. But after I rails new [filename] -d mysql, I can't rails server and most of command are missing symbol called. I am sure that I am open my mysql server. But I can't find any problem. Also, I am sure that I am in the correct location, because when I add gem "mysql2"into Gemfile and rails server, it will display
[!] There was an error parsing Gemfile: You cannot specify the same gem twice with different version requirements.You specified: mysql2 (~> 0.5.3) and mysql2 (>= 0). Bundler cannot continue.
It is my first time ask question in here and this my english is not good, I hope the form is correct.
rake db:create
dyld[75423]: missing symbol called
zsh: abort rake db:create
rails server
dyld[75560]: missing symbol called
zsh: abort rails server

Rails Server not Working (LoadErrror mysql2) Windows

I am trying to run rails server command but it showing mysql2 Load Error. I will place my Error log here
I searched many places.
I tried to install from my bundle itself using "gem install mysql2 --ruby=platform" command using connector c "libmysql.dll" file pasted in ruby/bin but no use.
I actually have MySQL installed on my system long back when I was doing JDBC connections. Its SQL server version 5.0- Is that version causing this error? Or Do I need to uninstall the MySQL from my system and install Latest Version!
And a doubt for me is how is this MySQL Server 5.0 connected to Rails as I no I have no idea about it, because while installation I used Connector C 6.1 for mysql2 installation from the Command Promt!
I tried Ruby on Rails - cannot load such file -- mysql2/2.2/mysql2 (LoadError)
I also tried Error "...cannot load such file -- mysql2/2.0/mysql2 (LoadError)". On Windows XP with Ruby 2.0.0
But I am getting the same error.
I think I have given all the details regarding versions and what I did!
I tried doing this like 50 times but no progress! I hope I will get my problem solved !Thank You!
The following below instructions can help you.
gem uninstall mysql2
Download last MySQL connector from http://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip
Extract it to C:\connector-6.0.2
gem install mysql2 --platform=ruby -- '--with-mysql-lib="C:\connector-
6.0.2\lib" --with-mysql-include="C:\connector-6.0.2\include" --with-mysql-
dir="C:\connector-6.0.2"'
Or even shorter:
gem install mysql2 --platform=ruby -- --with-opt-dir="C:\connector-6.0.2"
im not using windows. but seems to be duplicate with posts like this (Error "...cannot load such file -- mysql2/2.0/mysql2 (LoadError)". On Windows XP with Ruby 2.0.0)

Load Error for Ruby on Rails mysql2

Nubie at Ruby on Rails so I wanted to build a "Hello World" style of app to get familiar with RoR. The app I chose, along with tutorial on installation, was Dave Berube's "checkbook" app as in http://www.redhat.com/magazine/025nov06/features/ruby/
Yes it is from 2006 and maybe I have bumped into my errors because RoR has moved on through the years. Anyway, I get errors similar to banditKing with his app on 20th Sept., and many others; I get a persistent error as below.
When I ran RoR without creating my first app, it displayed the initial splash screen which effectively told me to "get working and create sites!" so that was a good start :-)
[running "rails generate migrate InitialSchema" to begin generating the application framework.]
/usr/local/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `require': cannot load such file -- mysql2/mysql2 (LoadError)
from /usr/local/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `<top (required)>'
My environment:
RH Enterprise Linux version 6, 64-bit
[root#svr checkbookapp]# which mysql
/usr/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.1.69 Source distribution
[root#svr checkbookapp]# which ruby
/usr/local/bin/ruby
[root#svr checkbookapp]# ruby -v
ruby 2.0.0p247 (2013-06-27) [x86_64-linux]
Rails version is 4.0.0
[root#svr checkbookapp]# gem list | grep mysql
mysql (2.9.1)
mysql2 (0.3.13)
Start of my app's Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.0.0'
gem 'mysql2'
...
I have added the library path to MySQL path into my .bash_profile as done by banditKing but that has not resolved this error. Have tried re-installing mysql2 gem several times and doing numerous "bundle install" operations. Downloaded and installed the connector 6.1 from the MySQL site and yum install'd the share and the development versions without any difference.
Try updating RubyGems with gem update --system. You should get something like version 2.x. There's a bug with RubyGems 1.8.x on Ruby 2.0 installing gems with c extentions (like mysql2 and nokogiri).

mysql2 version 0.3.6 installation in windows

I have installed ruby(1.9.2),gem(1.8.10) and rails(3.1.0), and MYSQL is runnig on WAMP. when I try to install mysql2 0.3.7 gem(gem install mysql2 -v 0.3.7)
when run the following command it shows error
and also tired
C:/dev/Ruby192/bin/ruby.exe extconf.rb --with-mysql-lib="c:\Program File
s\MySQL\MySQL Server 5.1\lib\opt" --with-mysql-include="c:\Program Files\MySQL\M
ySQL Server 5.1\include"
but looks like i dont have \lib and \include folders in my MYSQL installed directory(in this case D:\wamp\bin\mysql\mysql5.5.8).
please help me installing the mysql gem version greater than 0.3(as I am using Rails 3.1).
Any help will aapreciated.
Thanks
Nagendra
For those cases, you should try install either mysql or mysql2 gem against MySQL Connector/C
I've written a tutorial about that:
http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
Install Mysql Connector/C, it provides necessary lib and include files.
I am still having problem with mysql2 gem but below approach helped me install mysql with RoR on Windows Env.
Step 1 : Gem File changes : ({app}/Gemfile)
Update mysql2 --> mysql
Step 2 : Updates in database.yml file ({app}/config/database.yml)
Change adapter: mysql2 --> adapter: mysql
host: localhost --> host: 127.0.0.1
Step 3 : Downoad mysql-connector-c-noinstall-6.0.2-win32
Step 4 : Copy mysql-connector-c-noinstall-6.0.2-win32\lib\libmysql.dll file to C:\RailsInstaller\Ruby1.9.3\bin
Step 5 :bundle update && Start rails server

Glassfish can't find activerecord-jdbc-adapter

I'm trying to deploy simple Rails app on glassfish v3 and get the following error:
org.jruby.rack.RackInitializationException: Could not find RubyGem activerecord-jdbc-adapter (>= 0)
Environment details:
App is packaged as war using warbler.
JRuby 1.4.0 installed locally, with activerecord-jdbc-adapter gem installed.
App is configured to use derby database (migration is successful):
development:
host: localhost
adapter: jdbc
driver: org.apache.derby.jdbc.ClientDriver
url: jdbc:derby://localhost:1527/railsdb
username: rails
password: rails
System: Mac OS 10.6.2
Usually you need to tell Warbler to include the gem in the war file. You can do this by either adding the gem to your config/environment.rb as follows:
config.gem "activerecord-jdbc-adapter", :lib => false
Or by ensuring you have a Warbler configuration file ('warble config') and adding the following entry:
config.gems << "activerecord-jdbc-adapter"

Resources