@dan rathbun said:
Might be a good application for bundler:
http://bundler.io/#getting-started
I have spent the last 4 hours searching about bundler but I can't figure out how to use it inside sketchup's console. I'm really stressed... Can you give me some hints as to what it is I have to do?
EDIT: I managed to get the nokogiri-1.6.6.2-x86-mingw32 version to install by modifying rubygems.rb and platform.rb in the following places
# Array of platforms this RubyGems supports.
def self.platforms
@platforms ||= []
if @platforms.empty?
@platforms = ["x86-mingw32", Gem;;Platform.local]
end
@platforms
end
def self.match(platform)
Gem.platforms.any? do |local_platform|
platform.nil? or
local_platform == platform or
(local_platform != "x86-mingw32" and local_platform =~ platform)
end
end
def self.new(arch) # ;nodoc;
case arch
when Gem;;Platform;;CURRENT then
Gem;;Platform.local
when "x86-mingw32", nil, '' then
"x86-mingw32"
else
super
end
end
Then the rest of the gems installed with an unknown suffix but I can require nokogiri and savon with no exceptions thrown. I would like to find a better solution as this is hacking with the SU files which is not that good to do.
When I thought I had at least solved my problem I tried to run a simple savon client that works perfectly in my ruby installation and I get many errors on Sketchup::Console, logger.rb and savon.rb
client = Savon.client(wsdl; "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl")
response = client.call(;celsius_to_fahrenheit, message; { "Celsius" => "25" })
puts response.body
And this is the error log :
Error; #<TypeError; no implicit conversion of Sketchup;;Console into String>
C;/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/logger.rb;595;in `exist?'
C;/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/logger.rb;595;in `open_logfile'
C;/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/logger.rb;553;in `initialize'
C;/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/logger.rb;319;in `new'
C;/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/logger.rb;319;in `initialize'
C;/Users/Popi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Gems/gems/savon-2.11.1-unknown/lib/savon/options.rb;79;in `new'
C;/Users/Popi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Gems/gems/savon-2.11.1-unknown/lib/savon/options.rb;79;in `initialize'
C;/Users/Popi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Gems/gems/savon-2.11.1-unknown/lib/savon/client.rb;51;in `new'
C;/Users/Popi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Gems/gems/savon-2.11.1-unknown/lib/savon/client.rb;51;in `set_globals'
C;/Users/Popi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Gems/gems/savon-2.11.1-unknown/lib/savon/client.rb;15;in `initialize'
C;/Users/Popi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Gems/gems/savon-2.11.1-unknown/lib/savon.rb;10;in `new'
C;/Users/Popi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Gems/gems/savon-2.11.1-unknown/lib/savon.rb;10;in `client'
I tried the savon client on the ruby console, inside a ruby script, inside a UI.messagebox() with the same results in all.