I upgraded Ruby to 1.9.3, and watir stopped working. Did anyone experience the same issue?
Update watir has a dependency on ffi, just need to solve that.
It works for me:
C:\Ruby193\bin>ruby -v
ruby 1.9.3p0 (2011-10-30) [i386-mingw32]
C:\Ruby193\bin>gem list watir
*** LOCAL GEMS ***
watir (2.0.4)
C:\Ruby193\bin>irb
irb(main):001:0> require "watir"
=> true
irb(main):002:0> browser = Watir::Browser.new
C:/Ruby193/lib/ruby/gems/1.9.1/gems/windows-api-0.4.0/lib/windows/api.rb:4: Use RbConfig instead of obsolete and deprecated Config.
=> #<Watir::IE:0x..f867b09ec url="about:blank" title="">
irb(main):003:0>
Related
I am using ruby version 2.0.0, and Using soap4r (1.5.8).
But i couldn't able to load require "soap/wsdlDriver".
I am trying to use with in rails console,
irb(main):001:0> require 'soap/rpc/driver'
=> false
irb(main):002:0> require 'soap/rpc/driver'
=> false
irb(main):003:0> require "soap/wsdlDriver"
=> false
The standard soap library was removed from Ruby. You will need to find an other solution. Perhaps this gem: https://rubygems.org/gems/soap4r-ruby1.9
Or you refactor you code to use a more up-to-date client. Find a list here: https://www.ruby-toolbox.com/categories/soap
When I require 'nokogiri' in Ruby 2.0, it has a error
`require': cannot load such file -- nokogiri/2.0/nokogiri (LoadError)
Is nokogiri not supporting Ruby 2.0 yet? I can see nokogiri in gem list
Ruby 2.0 support is not yet available for Windows. Follow along here for updates:
Yes, it works fine:
RUBY_VERSION # => "2.0.0"
require 'nokogiri'
doc = Nokogiri::HTML('<html><body><p>foo</p></body></html>')
doc.at('p').text # => "foo"
Nokogiri now support Ruby 2.0, even on Windows, see HERE
I used the rubyzip gem in Ruby 1.8.7 before, but I heard rubyzip doesn't work well with ruby 1.9.2.
What zip libraries work well with Ruby 1.9.2?
Have you actually tried using rubyzip with 1.9.2? Seems to work fine for me:
>> RUBY_VERSION
#=> "1.9.2"
>> require 'zip/zip'
#=> true
>> Zip::ZipFile.foreach(File.expand_path("~/Downloads/Archive.zip")) { |f| p f }
#=> [bartxt, footxt]
bar.txt
foo.txt
I used rubyzip gem in Ruby 1.8.7 also. For Ruby 1.9.x you need to use version 0.9.5 or higher. Works without any problems.
I found zip it says it's compatible with 1.9.1 I don't think it would have any issues in 1.9.2
I've installed the Curb and Curb-fu gem and libcurl on my Ubuntu box.
If I go into irb and run the following
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'curb'
=> true
irb(main):003:0> require 'json'
=> true
irb(main):004:0> require 'curb-fu'
=> true
irb(main):005:0>
So it seems that I have access to all the gems.
But I've created a very simple ruby app that's giving me an error:
#!/usr/bin/ruby
require 'rubygems'
require 'curb'
require 'json'
require 'curb-fu'
response = CurbFu.get('http://slashdot.org')
puts response.body
I get the following error back.
/usr/lib/ruby/gems/1.8/gems/curb-fu-0.4.4/lib/curb-fu/authentication.rb:3: uninitialized constant CurbFu::Authentication::Curl (NameError)
I have a feeling it's something to do with libcurl and have tried several different versions but still no joy.
Can anyone offer any assistance?
Cheers
Togs
I managed to get it to work.
I uninstalled both the curb and curb-fu gem and re-installed them.
I now have curb-fu working.
For future reference for anyone having problems with this.. these are the libcurl bits I installed.
libcurl3
libcurl3-gnutls
libcurl4-openssl-dev
Specifically, the ruby-oci8 gem. I have both 1.0.7 and 2.0.4 installed. I want 1.0.7.
I can just require oci8, but I don't get the version I want.
irb(main):001:0> require 'oci8'
=> true
irb(main):002:0> OCI8::VERSION
=> "2.0.4"
I can require using the full path to the file, which works, but is not going to be portable:
irb(main):001:0> require 'C:\Ruby\lib\ruby\gems\1.8\gems\ruby-oci8-1.0.7-x86-mswin32-60\lib\oci8'
=> true
irb(main):002:0> OCI8::VERSION
=> "1.0.7"
I can use the gem command to ask for the version I want, but it doesn't appear to actually load the library:
irb(main):001:0> gem 'ruby-oci8', :lib=>'oci8', :version=>'=1.0.7'
=> true
irb(main):002:0> OCI8::VERSION
NameError: uninitialized constant OCI8
from (irb):2
I would definitely favor this last approach if would load the library, rather than just confirming that it's present on my system. What am I missing?
My problem was twofold:
1) confusing gem command syntax with that used in config.gem lines in a rails environment.rb configuration file.
2) failing to issue a require command after the gem command.
Proper usage in a script is:
gem 'ruby-oci8', '=1.0.7'
require 'oci8' # example is confusing; file required (oci8.rb) is not
# same name as gem, as is frequently the case
Proper usage in a rails 2.3.x environment.rb file is:
config.gem "ruby-oci8", :version=>'1.0.7'
Thanks to the folks at http://www.ruby-forum.com/topic/109100
Try the following syntax (instead of require):
require_gem 'RMagick' , '=1.10'
require_gem 'RMagick' , '>=1.10'
require_gem 'rake', '>=0.7.0', '<0.9.0'