Firewatir: Firewatir is not opening Firefox - ruby

FireWatir
I recently started using Firewatir for testing, I followed all the required steps while installing firewatir but I am not able to run the script.
Here is the information from my local machine
ruby version: ruby 1.9.1p429 (2010-07-02 revision 28523) [i386-mingw32]
gems installed:
C:>gem list
* LOCAL GEMS *
activesupport (3.0.0, 2.3.8)
builder (2.1.2)
commonwatir (1.6.5)
firewatir (1.6.5)
hoe (2.6.2)
json_pure (1.4.6)
rake (0.8.7)
rubyforge (2.0.4)
s4t-utils (1.0.4)
user-choices (1.1.6.1)
xml-simple (1.0.12)
########I used the sample script from the web
#Include the FireWatir file.
require 'firewatir'
ff=FireWatir::Firefox.new
#Open yahoo mail.
ff.goto("http://mail.yahoo.com")
#Put your user name.
ff.text_field(:name,"login").set("User_Name")
#Put your password.
ff.text_field(:name,"passwd").set("Password")
#Click Sign In button.
ff.button(:value,"Sign In").click
#Click Sign Out button.
ff.link(:text, "Sign Out").click
#Close the browser.
ff.close
When I run the above script from the command prompt, instead of opening the firefox browser, it is opening a dialog box to select a program to open this.
I really appreciate that if anyone can help me with this or point me to the right directions.
Thanks

I was able to resolve the issue,not sure exactly how but I followed the following steps:
1. Uninstall and install ruby
2. gem update
3. rolled back activesupport from version 3.0.0 to activesupport 2.3.8.
4. uninstalled JSSH and installed it again and that sure fixed the issue

Related

binding_of_caller gem not being invoked in Rails 4

I really like the better_errors gem in development and on my os x machine get the REPL to appear. Now I'm learning the vagaries of Windows XP and find that while better_errors works, the REPL does not appear, helpfully suggesting I install the binding_of_caller gem. Starting from a RailsApp starter my gemfile shows the below:
group :development do
gem 'better_errors'
gem 'binding_of_caller', :platforms=>[:mri_19, :mri_20, :rbx]
gem 'quiet_assets'
gem 'rails_layout'
end
I'm running Ruby 2.0.0-p353 using pik 0.3.0 pre. I have run gem install binding_of_caller and I saw no errors installing. Here's my output of bundle show _binding_of_caller_
Could not find gem 'binding_of_caller' Did you mean binding_of_caller?
I've commented out the call to the platforms in the GemfileOK, but the REPL is still not loading.
my Windows fu is not very bright, but I haven't found anything on Google that would suggest a solution. Reading up on the github page suggests I'm not doing anything wrong. What should I try next? thanx, sam
I've just moved my app to a new Win7 machine. Unfortunately, binding_of_caller is still not being raised, though it works fine on my OS X machine. So there's something on Windows I'm not doing right.

Guard not detecting file changes until I interact with terminal

I'm trying to get Guard to detect file system changes while I'm working with SASS files. I want them to be compiled to CSS. I don't want to interact with the terminal every time I make a change though. It should just happen automatically. Right now, I have to press enter at the terminal to get it to compile.
When I do gem query --loacl I get this:
coderay (1.0.9)
ffi (1.8.1)
formatador (0.2.4)
guard (1.8.0)
guard-sass (1.1.0)
listen (1.0.3)
lumberjack (1.0.3)
method_source (0.8.1)
pry (0.9.12.1)
rb-fsevent (0.9.3)
rb-inotify (0.9.0)
rb-kqueue (0.2.0)
sass (3.2.9, 3.2.8)
slop (3.4.4)
thor (0.18.1)
I should note that this will eventually be a guard init on a Samba share; the directory is not on my physical machine, but I am testing on my local hard drive.
To initialize the guard project, I did guard init and then guard on my 'Portfolio' directory. This my directory structure:
-- Portfolio
-- sass
-- css
-- Guardfile (file)
And this is the contents of my guard file:
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'sass', :input => 'sass', :output => 'css'
I read something about Ruby being compiled against libedit instead of readline. How can I check if this is the issue?
It appears the issue was in fact that Ruby wasn't using readline. I am not a Ruby expert, so I don't know for sure if this was the issue or not. I did follow the directions here and installed the Ruby Version Manager (RVM) and reinstalled Ruby to version 1.9.3 (although I think I could have used the latest 2.0.0) and I reinstalled the guard and guard-sass gems and now my filesystem changes are being detected automatically.

Ruby Builder conflict

I have a small ruby app that has been working. I am now getting a conflict error with builder. It looks like I updated my gems and now it is conflicting. I have it set in the Gemfile to use v2.1.2. But that is not working either. Thanks for any help you can give me.
Gemfile
gem 'builder', '2.1.2'
Bundler output
$ bundle
Using builder (2.1.2)
Using bundler (1.2.3)
$ bundle show builder
/Users/covard/.rvm/gems/ruby-1.9.3-p327/gems/builder-2.1.2
Conflict message
`raise_if_conflicts': Unable to activate actionpack-3.2.11, because rack-1.5.0 conflicts with rack (~> 1.4.0), builder-3.1.4 conflicts with builder (~> 3.0.0) (Gem::LoadError)
Figured out what my problem was even though I had my Gemfile I wasn't using it. Since rails handles that automatically I didn't know I had to add a require to use it. After adding this to my ruby files it worked perfectly.
require "bundler/setup"

Problem with Firewatir requiring different version of activesupport

I have a script that uses Watir to retrieve information from Web pages. It works fine as a standalone script. Now I would like to create a Padrino Rake task based on it, and attempt to run the script results in an error:
can't activate activesupport (= 2.3.9) for "firewatir-1.6.7", already activated activesupport-3.0.3 for "padrino-core-0.9.19"
I understand the reason for the problem: Firwatir demands an older version of activesupport. But can this demand be overruled?
have you tried padrino-core-0.9.15? it uses activesupport 2.3.8
gem install padrino-core -v 0.9.15
that would be the first thing I'd try.
Dave

Rspec bundle is broken in TextMate and rvm

I've had a difficult time since I started using rvm. I've done all the rvm/textmate set up and have the latest bundles but I still can't run Rspec test from textmate.
I have the latest bundle from github.com/rspec/rspec-tmbundle.git
and it's installed in ~/Library/Application\ Support/TextMate/Bundles/
RSpec.tmbundle
RVM default is using the system ruby 1.8.6
Rspec gem versions
gem list --local | grep spec
blue_light_special (0.2.0)
rspec (2.2.0)
rspec-core (2.2.1, 2.0.1)
rspec-expectations (2.2.0, 2.0.1)
rspec-mocks (2.2.0, 2.0.1)
rspec-rails (2.0.1, 1.3.2)
TextMate
TM_RUBY=/Users/jspooner/.rvm/bin/rvm-auto-ruby
The Error: rspec/core (LoadError)
/Users/jspooner/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:29:in require': no such file to load -- rspec/core (LoadError) from /Users/jspooner/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:29 from /tmp/textmate-command-8073.rb:2:inrequire' from /tmp/textmate-command-8073.rb:2
The best solution I've found is from Jacques Crocker.
http://groups.google.com/group/rubyversionmanager/browse_thread/thread/64b84bbcdf49e9b?fwc=1
It requires replacing the contents of textmate_ruby with the code below and never running rvm wrapper xxx textmate again.
#!/usr/bin/env sh
source ~/.rvm/scripts/rvm
cd .
exec ruby "$#"
This has also fixed the same issue with the cucumber bundle.
Did you try following the instructions here: http://rvm.io/integration/textmate/
My case is slightly different but took me more than an hour to figure out:
Turns out I ran rvm wrapper ree textmate a while after installing ree with rvm and in the mean time the ree shorthand changed from meaning ree-1.8.7-2010.01 to ree-1.8.7-2010.02
here's more details on my message:
https://gist.github.com/721987
I'm posting it here too because it's one of the first pages I landed onto while trying to figure this one out.
I've got a similar problem and figured out that my textmate ruby wrapper is pointing to a different version. I was able to get it work by putting below content in projectx/.rvmrc
rvm 1.9.2#projectx --create
rvm wrapper 1.9.2#projectx textmate
Hope this helps.

Resources