Closed cabrinoob closed 6 years ago
I encountered a similar issue when working with Postgres Database and from the Gitter chat room I saw that you may need to install the adapter for MySQL. A similar approach for MySQL should have something like this:
gem install mysql
gem install bundler
bundler init
to create a Gem file for the project gem 'mysql
, '~>0.3.11'I hope this works!
Hi Cabri, Could you solved the problem? I have the same problem from centos 7.
@jankko, running gem install mysql
should fix your problem.
(You'll will also need to have mysql installed on that system)
I have already installed that gem, I using Mariadb
and you are still getting that issue?
yeah, I share my environment. MongoDB and MariaDB in CentoOS 7 Ruby 2.0.0p648 in CentOS 7 Ruby 2.4.4p296 in Windows 7 to try to conect to centOS 7.
When I create the database.conf I can create this file in any path or need it some specific file or location in the mongify gem?
I'm not sure i understand the "Sharing environment" part. If the both DBs are on CentOS 7, are you running mongify on CentOS?
C:\Ruby24-x64\mongify>mongify check database.conf
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/active_record/con
nection_adapters/connection_specification.rb:177:in rescue in spec': Specified 'mysql' for database adapter, but the gem is not loaded. Add
gem 'mysql'to yo ur Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError) from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/acti ve_record/connection_adapters/connection_specification.rb:174:in
spec'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activerecord-4.2.10/lib/acti
ve_record/connection_handling.rb:50:in establish_connection' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.2/lib/mongify/da tabase/sql_connection.rb:40:in
setup_connection_adapter'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.2/lib/mongify/da
tabase/sql_connection.rb:56:in has_connection?' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.2/lib/mongify/cl i/command/worker.rb:99:in
check_sql_connection'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.2/lib/mongify/cl
i/command/worker.rb:68:in execute' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.2/lib/mongify/cl i/application.rb:28:in
execute!'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.2/bin/mongify:17
:in <top (required)>' from C:/Ruby24-x64/bin/mongify:23:in
load'
from C:/Ruby24-x64/bin/mongify:23:in `
I test Mongify in CentOS 7 and Windows 7 and in both a get the same error.
[root@localhost mongify]# mongify check database.config
/usr/local/share/gems/gems/activerecord-4.2.10/lib/active_record/connection_adapters/connection_specification.rb:177:in rescue in spec': Specified 'mysql' for database adapter, but the gem is not loaded. Add
gem 'mysql'to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError) from /usr/local/share/gems/gems/activerecord-4.2.10/lib/active_record/connection_adapters/connection_specification.rb:174:in
spec'
from /usr/local/share/gems/gems/activerecord-4.2.10/lib/active_record/connection_handling.rb:50:in establish_connection' from /usr/local/share/gems/gems/mongify-1.3.2/lib/mongify/database/sql_connection.rb:40:in
setup_connection_adapter'
from /usr/local/share/gems/gems/mongify-1.3.2/lib/mongify/database/sql_connection.rb:56:in has_connection?' from /usr/local/share/gems/gems/mongify-1.3.2/lib/mongify/cli/command/worker.rb:99:in
check_sql_connection'
from /usr/local/share/gems/gems/mongify-1.3.2/lib/mongify/cli/command/worker.rb:68:in execute' from /usr/local/share/gems/gems/mongify-1.3.2/lib/mongify/cli/application.rb:28:in
execute!'
from /usr/local/share/gems/gems/mongify-1.3.2/bin/mongify:17:in <top (required)>' from /usr/local/bin/mongify:23:in
load'
from /usr/local/bin/mongify:23:in `
and both had gem install mysql
ran?
yeah, how I add the mysql gem to Gemfile of Mongify?
In CentOS I have this problems: [root@localhost mongify-1.3.2]# gem install mysql ERROR: Could not find a valid gem 'mysql' (>= 0) in any repository [root@localhost mongify-1.3.2]# gem sources --add https://rubygems.org/ Error fetching https://rubygems.org/: SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://rubygems.org/specs.4.8.gz) [root@localhost mongify-1.3.2]#
In Windows 7 : C:\Ruby24-x64\lib\ruby\gems\2.4.0\gems\mongify-1.3.2>gem install mysql Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension.
current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mysql-2.9.1/ext/my
sql_api C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20180614-312-1i3yzhr.rb extconf.rb checking for -llibmysql... no extconf.rb failed Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=C:/Ruby24-x64/bin/$(RUBY_BASE_NAME) --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-libmysqllib --without-libmysqllib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/mysql-2.9.1/mkm f.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mysql- 2.9.1 for inspection. Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0 /mysql-2.9.1/gem_make.out
I'd have to say, it might not work in windows, it wasn't originally designed to run under windows...
Even in a container? Under windows, but in a container ?
ok share me the environment for mongify. os,database,ruby version,etc all that I need.
It should work fine in ubuntu 16.04, Ruby 2.2, mysql and mongodb version 3.2 or earlier.
With Ubuntu 16.04 and Ruby 2.2 I cant install the mongifiy gem Building native extensions. This could take a while... ERROR: Error installing mongify: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.2 -r ./siteconf20180616-4140-1hutsd3.rb extconf.rb
checking for asprintf()... extconf.rb failed Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.2
/usr/lib/ruby/2.2.0/mkmf.rb:456:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /usr/lib/ruby/2.2.0/mkmf.rb:541:in
try_link0'
from /usr/lib/ruby/2.2.0/mkmf.rb:556:in try_link' from /usr/lib/ruby/2.2.0/mkmf.rb:735:in
try_func'
from /usr/lib/ruby/2.2.0/mkmf.rb:1020:in block in have_func' from /usr/lib/ruby/2.2.0/mkmf.rb:911:in
block in checking_for'
from /usr/lib/ruby/2.2.0/mkmf.rb:351:in block (2 levels) in postpone' from /usr/lib/ruby/2.2.0/mkmf.rb:321:in
open'
from /usr/lib/ruby/2.2.0/mkmf.rb:351:in block in postpone' from /usr/lib/ruby/2.2.0/mkmf.rb:321:in
open'
from /usr/lib/ruby/2.2.0/mkmf.rb:347:in postpone' from /usr/lib/ruby/2.2.0/mkmf.rb:910:in
checking_for'
from /usr/lib/ruby/2.2.0/mkmf.rb:1019:in have_func' from extconf.rb:3:in
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.2.0/gems/bson_ext-1.12.5 for inspection. Results logged to /var/lib/gems/2.2.0/extensions/x86_64-linux/2.2.0/bson_ext-1.12.5/gem_make.out
@Jankko You need to have the dev tools installed:
sudo apt-get install build-essential
Read more at https://tecadmin.net/install-development-tools-on-ubuntu/
I got it I done. Thank you @anlek
Awesome! Good luck with your move
is the driver for SQL and mysql is same or i have to also install the SQL driver. i am connecting NoSQL successfully but the only error i am getting is the missing software. can you gus please help me in this regard.
Hi, I tried to make mongify work on my Windows 10. It fails I tried to make it work inside a container (ubuntu) and it fails with the same error.
I followed the getting started guide.
I installed ruby/gem for windows with the dev-kit. I tried v2.4 or v2.2. Same problem. In my "dockerized" ubuntu, I tried
apt-get install ruby-full
or via RVM, I always have this error.I'd just like to try mongify, so I have a mongo database running in a docker container and a mysql database also running in a docker container. They are both working fine.
What I have missed?
Thank you