If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Rubygems
12 posts
• Page 1 of 2 • 1, 2
Re: Rubygems
- Code: Select all
gem install mysql
gem install sqlite3-ruby
gem list
how do i accomplish this ?
mr DSP how do you install and use gems?
- sal
- Posts: 42
- Joined: Thu Aug 19, 2010 4:56 pm
Re: Rubygems
Have you tried to install the gems manually?sal wrote:How do I accomplish this ?
- Code: Select all
gem install mysql
gem install sqlite3-ruby
gem list
http://docs.rubygems.org/read/chapter/3
- infuzion
- Posts: 109
- Joined: Tue Jul 13, 2010 11:55 am
- Location: Kansas City, USA, Earth, Sol
Re: Rubygems
yes i tried that, but at the moment the use of gems is not allowed as confirmed by dsp robotics on pm due to bugs caused by gems on windows platform.
Hope they will find a solution at least for adding database connectivity and network usage.
Hope they will find a solution at least for adding database connectivity and network usage.
- sal
- Posts: 42
- Joined: Thu Aug 19, 2010 4:56 pm
Re: Rubygems
Oh, OK, cheers.
- infuzion
- Posts: 109
- Joined: Tue Jul 13, 2010 11:55 am
- Location: Kansas City, USA, Earth, Sol
Re: Rubygems
Sal - here's the workaround to get Gems working inside FS.
As said before many of the Gems will not work on Windows!
FOR ADVANCED PROGRAMMERS ONLY!!!
Step 1) Install Ruby on your PC
In order for this to work it needs to be a mswin32 compiled version of Ruby not a ming32 version.
Try this: http://www.dsprobotics.com/Files/Ruby192MSwin.zip
Just copy the folder to somewhere on your PC, you can also have the ming32 one installed in a different folder.
Check: Ruby -v
Should say something like: i386-mswin32
Step 2) Create a shortcut on your desktop
Right click - shortcut etc.
Use this string: C:\WINDOWS\system32\cmd.exe /E:ON /K D:\Ruby192MSwin\bin\setrbvars.bat
but remember to modify the path to match your ruby installation.
Step 3) download Install Gem on your system:
Put the downloaded gem in the gem folder: D:\Ruby192MSwin\lib\ruby\gems\1.9.1\gems (using your own path)
then in Ruby:
gem install gemname
You should see the gem install:
Step 4) Add the new path to FlowStone's ruby
Open FS2 and enter something like this into a Ruby edit module:
$LOAD_PATH << "D:/Ruby192MSwin/lib/ruby/gems/1.9.1/gems/myGemFolder"
Remembering to use / not \
This only has to be done once!
Step 4) Test Gem
Start with a new Ruby Edit module and test if it loads:
ie. require 'MyGemName'
Results: the first time it load you get a result of True, from then on False - both are good it has been loaded!
If the loaded gem causes a crash then it is the gem that doesn't work on Windows NOT FlowStone!
Thanks 'DSP' for you help on this..
As said before many of the Gems will not work on Windows!
FOR ADVANCED PROGRAMMERS ONLY!!!
Step 1) Install Ruby on your PC
In order for this to work it needs to be a mswin32 compiled version of Ruby not a ming32 version.
Try this: http://www.dsprobotics.com/Files/Ruby192MSwin.zip
Just copy the folder to somewhere on your PC, you can also have the ming32 one installed in a different folder.
Check: Ruby -v
Should say something like: i386-mswin32
Step 2) Create a shortcut on your desktop
Right click - shortcut etc.
Use this string: C:\WINDOWS\system32\cmd.exe /E:ON /K D:\Ruby192MSwin\bin\setrbvars.bat
but remember to modify the path to match your ruby installation.
Step 3) download Install Gem on your system:
Put the downloaded gem in the gem folder: D:\Ruby192MSwin\lib\ruby\gems\1.9.1\gems (using your own path)
then in Ruby:
gem install gemname
You should see the gem install:
Step 4) Add the new path to FlowStone's ruby
Open FS2 and enter something like this into a Ruby edit module:
$LOAD_PATH << "D:/Ruby192MSwin/lib/ruby/gems/1.9.1/gems/myGemFolder"
Remembering to use / not \
This only has to be done once!
Step 4) Test Gem
Start with a new Ruby Edit module and test if it loads:
ie. require 'MyGemName'
Results: the first time it load you get a result of True, from then on False - both are good it has been loaded!
If the loaded gem causes a crash then it is the gem that doesn't work on Windows NOT FlowStone!
Thanks 'DSP' for you help on this..
- Embedded
- Posts: 143
- Joined: Sat Oct 30, 2010 1:42 pm
Re: Rubygems
Embedded - You're welcome, glad I could help...
Also worth mentioning is that gems are all the rage, but on Windows dll's have been doing these things for years.
dlls work perfectly with FlowStone V2 & Ruby on Windows, so if you have any specific need it's probably more reliable to just make a call to the dll.
Also worth mentioning is that gems are all the rage, but on Windows dll's have been doing these things for years.
dlls work perfectly with FlowStone V2 & Ruby on Windows, so if you have any specific need it's probably more reliable to just make a call to the dll.
- DSP
- Posts: 150
- Joined: Fri May 14, 2010 10:55 pm
Re: Rubygems
i have already tested this but for example this simple sock call
stop the ruby code
""Execessive processing detected...etc.etc"
and even this
require 'Win32API'
but the oddity is that, by removing the buffer size, working
getWindowText.Call(window_handle, title_buffer,512)
getWindowText.Call(window_handle, title_buffer)
- Code: Select all
require'socket'
#Socket.ip_address_list
Addrinfo.udp("192.168.0.2", 10001).bind {|s|
p s.recv(10) #=> "hello"
}
stop the ruby code
""Execessive processing detected...etc.etc"
and even this
require 'Win32API'
- Code: Select all
getForegroundWindow = Win32API.new('user32', 'GetForegroundWindow', 'V', 'L')
window_handle = getForegroundWindow.Call()
getWindowText = Win32API.new('user32', 'GetWindowText', 'LP', 'I')
title_buffer = ' ' * 512
getWindowText.Call(window_handle, title_buffer,512)
title_buffer
but the oddity is that, by removing the buffer size, working
getWindowText.Call(window_handle, title_buffer,512)
getWindowText.Call(window_handle, title_buffer)
- Code: Select all
getForegroundWindow = Win32API.new('user32', 'GetForegroundWindow', 'V', 'L')
window_handle = getForegroundWindow.Call()
getWindowText = Win32API.new('user32', 'GetWindowText', 'LP', 'I')
title_buffer = ' ' * 512
getWindowText.Call(window_handle, title_buffer)
title_buffer
- Tronic
- Posts: 539
- Joined: Wed Dec 21, 2011 12:59 pm
12 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: Google [Bot] and 96 guests