Skip to content

Instantly share code, notes, and snippets.

$ ruby click.rb
/home/test/.bundle/ruby/1.8/gems/selenium-webdriver-0.0.27/lib/selenium/webdrive
r/ie/bridge.rb:594:in `check_error_code': unable to find element by xpath using
"//input[@id='signInSubmit']" (17) (Selenium::WebDriver::Error::UnexpectedJavasc
riptError)
from /home/test/.bundle/ruby/1.8/gems/selenium-webdriver-0.0.27/lib/sele
nium/webdriver/ie/bridge.rb:315:in `findElementByXpath'
from /home/test/.bundle/ruby/1.8/gems/selenium-webdriver-0.0.27/lib/sele
nium/webdriver/ie/util.rb:48:in `create_element'
from /home/test/.bundle/ruby/1.8/gems/selenium-webdriver-0.0.27/lib/sele
gabe@flo:~/reframeit-v3 (master)$ rails s
=> Booting WEBrick
=> Rails 3.0.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/home/gabe/.rvm/gems/ree-1.8.7-2010.02@master/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:108:in `constantize': private method `split' called for :parent_user:Symbol (NoMethodError)
from /home/gabe/.rvm/gems/ree-1.8.7-2010.02@master/gems/activesupport-3.0.3/lib/active_support/core_ext/module/introspection.rb:31:in `parent'
from /home/gabe/.rvm/gems/ree-1.8.7-2010.02@master/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:496:in `load_missing_constant'
from /home/gabe/.rvm/gems/ree-1.8.7-2010.02@master/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:183:in `const_missing'
gabe@flo:~/reframeit-v3 (master)$ rvm gemset empty
Are you SURE you wish to remove the installed gemset for gemset 'ree-1.8.7-2010.02@master' (/home/gabe/.rvm/gems/ree-1.8.7-2010.02@master)?
(anything other than 'yes' will cancel) > yes
gabe@flo:~/reframeit-v3 (master)$ gem install bundler
Successfully installed bundler-1.0.7
1 gem installed
Installing ri documentation for bundler-1.0.7...
Installing RDoc documentation for bundler-1.0.7...
gabe@flo:~/reframeit-v3 (master)$ bundle install
Updating git://github.com/mongoid/mongoid
Bundler could not find compatible versions for gem "mongoid":
In snapshot (Gemfile.lock):
mongoid (2.0.0.beta.18)
In Gemfile:
delayed_job_mongoid depends on
mongoid (~> 2.0.0.rc)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
gabe@flo:~/reframeit-v3 ((no branch))$ bundle update
Updating git://github.com/mongoid/mongoid
Updating git://github.com/coshx/mongo_session_store
Updating git://github.com/jnicklas/carrierwave.git
Updating git://github.com/thoughtbot/factory_girl.git
Updating git://github.com/thoughtbot/factory_girl_rails.git
Updating git://github.com/bmabey/email-spec.git
Updating http://github.com/oauth/oauth-ruby.git
Unpacking objects: 100% (9/9), done.
Fetching source index for http://rubygems.org/
abe@flo:~/reframeit-v3 (master)$ rails s
**Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance.
You can install the extension as follows:
gem install bson_ext
If you continue to receive this message after installing, make sure that the
bson_ext gem is in your load path and that the bson_ext and mongo gems are of the same version.
/home/gabe/.rvm/gems/ree-1.8.7-2010.02@master/gems/bundler-1.0.7/lib/bundler/shared_helpers.rb:101:Warning: Gem::LoadError#version_requirement= is deprecated and will be removed on or after January 2011. Use #requirement.
@gkop
gkop / gist:835401
Created February 19, 2011 21:50
rails 3.04 runtime error example
Started POST "/comments/workbook_header" for 127.0.0.1 at Sat Feb 19 14:46:25 -0700 2011
reframeit_v3_development['action_dispatch_session_mongoid_store_sessions'].find({:_id=>BSON::ObjectId('4d601aaf8a19525a12000054')}, {}).limit(-1)
Processing by CommentsController#workbook_header as JSON
Parameters: {"section"=>"law9-intro", "page"=>"http://localhost:3000/documents/law-9-english"}
Completed in 0ms
RuntimeError (#destroy needs to be implemented.):
@gkop
gkop / gist:1371962
Created November 17, 2011 00:13
Capture javascript errors in Cucumber+Capybara+Webdriver tests
# in features/support/env.rb
require 'selenium/webdriver'
# we need a firefox extension to start intercepting javascript errors before the page
# scripts load
Capybara.register_driver :selenium do |app|
profile = Selenium::WebDriver::Firefox::Profile.new
# see https://github.com/mguillem/JSErrorCollector
profile.add_extension File.join(Rails.root, "features/support/extensions/JSErrorCollector.xpi")
Capybara::Selenium::Driver.new app, :profile => profile
@gkop
gkop / gist:1424593
Created December 2, 2011 19:49
convoluted alternative to which which
# bash lies
$ time --version
--version: command not found
real 0m0.127s
user 0m0.120s
sys 0m0.020s
$ /usr/bin/time --version
@gkop
gkop / gist:1531106
Created December 29, 2011 01:55
parallel_tests without ActiveRecord
namespace :db do
desc "Stub out to use with parallel_tests gem without ActiveRecord"
task :abort_if_pending_migrations do
end
end