This is a source gem, that needs the Ruby DevKit installed on the end user system, because it needs to be compiled at install time. But, SketchUp embedded Ruby is not yet set up to be hooked into the Ruby DevKit. So, gems that need compiling are a problem for SketchUp.
Choices, are:
(A) to install both the 32-bit and 64-bit Ruby DevKits and pre-compile the gem for each platform and bitness, and distribute them with your plugin code, using a conditional expression to choose the correct (platform and bitnees) compiled library to load into SketchUp’s embedded Ruby.
(B) find already pre-compiled binaries of the library, and package them with your plugin.
(C) find alternate pure-ruby library gem(s) that do not need compiling, and therefor are already cross-platform.
I have Ruby 2.0.3
i tried to install Mysql-ruby from the Sketchup ruby console using : Gem.install(“mysql-ruby”)
but it gave me this error.
Gem.install(“ruby-mysql”)
Error: #<Gem::SpecificGemNotFoundException: Could not find a valid gem ‘ruby-mysql’ (>= 0) locally or in a repository>
C:/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems/dependency_installer.rb:301:in find_spec_by_name_and_version' C:/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems/dependency_installer.rb:110:in available_set_for’
C:/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems/dependency_installer.rb:322:in install' C:/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems.rb:526:in install’
This is the version of the RubyGems extension, not the Ruby build itself. (Notice how it is wrapped within the Gem namespace module ?)
The version of Ruby is set to the global constant RUBY_VERSION, example:
puts "The version of Ruby is: "<<RUBY_VERSION
Yes, the gem’s latest version is 2.9.14
You keep writing “mysql-ruby”,… the correct identifier for the gem is: "ruby-mysql"
We cannot see the error output. You need to wrap error output in a preformatted textblock (use the “</>” button on the posting edit toolbar,) or wrap the whole block of error text in a block like:
``` Gem.install("ruby-mysql") Error: #<GemInstallError: could not read respository for "ruby-mysql">
… the rest of the error text and backtraces, etc., … ```
A multiline preformatted textblock begins with three 3 backticks (```) on a line by themselves, and ends with three 3 backticks (```) on a line by themselves.