ruby-1.9.2

capybara - Find with xPath is leaving the within scope

雨燕双飞 提交于 2019-12-05 01:06:36
I am trying to build a date selector with Capybara using the default Rails date, time, and datetime fields. I am using the within method to find the select boxes for the field but when I use xPath to find the correct box it leaves the within scope and find the first occurrence on the page of the element. Here is the code I am using. The page I am testing on has 2 datetime fields but I can only get it to change the first because of this error. At the moment I have an div container with id that wraps up the datetime field but I do plan on switching the code to find by the label. module Marketron

Whenever gem won't update crontab tasks

删除回忆录丶 提交于 2019-12-04 10:43:08
I have been using the whenever gem on my 2+ year old slice at Slicehost. I can't however do the same on my new slice. Main differences is that I'm now running RVM on both my MBP and the slice. I am also running Rails 3. I've got Rubygems v 1.5.0 and latest versions of RVM , Ruby 1.9.2p136, Capistrano and about every other package out there. I have tried a million things, read all the docs and as of now I'm using the whenever gem version 0.6.2. I have also looked at all questions on related topics on SO as well as Google. Here is the code in deploy.rb: namespace :deploy do ... desc "Update the

load works on local path, require doesn't

为君一笑 提交于 2019-12-04 10:00:37
问题 loadee.rb puts '> This is the second file.' loaddemo.rb puts 'This is the first (master) program file.' load 'loadee.rb' puts 'And back again to the first file.' When I run "ruby loaddemo.rb" , This works fine. Both files are in the same directory, and that's the directory I run from. But if I change the load to a require, and with or without the extension I get: <internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- loadee.rb (LoadError) from <internal:lib/rubygems

Extract the AST from a Ruby block

你说的曾经没有我的故事 提交于 2019-12-04 04:08:16
Is it possible to grab the AST of a block from Ruby itself? I've had a look at both ParseTree and ruby_parser, but they both seem to have sketchy support (from what I've read) for Ruby 1.9.2. I need something that works well with 1.9.2. Ripper is included in MRI 1.9 out of the box. ruby-1.9.2-p180 :004 > require 'ripper' => true ruby-1.9.2-p180 :005 > Ripper.sexp("def a; end") => [:program, [[:def, [:@ident, "a", [1, 4]], [:params, nil, nil, nil, nil, nil], [:bodystmt, [[:void_stmt]], nil, nil, nil]]]] In 1.8, Ruby executes the code by traversing the AST, so it is possible to get the AST for a

javascript runtime in rails 3.1.0 and ruby 1.9.2. cant deal with with heroku. Did everything, but still does not working

给你一囗甜甜゛ 提交于 2019-12-04 01:30:47
问题 Please help, it's my studying project. It work locally but not online: Hello, it is said that i dont need special gems like "therubyracer" in rails 3.1.0 but it writes in "heroku logs": 2011-10-04T23:15:30+00:00 app[web.1]: ActionView::Template::Error (Could not fin d a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. 2011-10-04T23:15:30+00:00 app[web.1]: (in /app/app/assets/javascripts/rails.js )):.... i was trying to install "therubyracer" but

DBI::InterfaceError: Could not load driver (uninitialized constant MysqlError)

て烟熏妆下的殇ゞ 提交于 2019-12-03 16:15:01
I have included gems, dbd-mysql (0.4.4) dbi (0.4.5) mysql (2.8.1) on rails console when I run the following code, require 'rubygems' require "dbi" require 'dbd-mysql' dbh = DBI.connect("DBI:Mysql:TestDB:localhost","username", "pwd") 1.9.2-p180 :001 > require 'rubygems' => false 1.9.2-p180 :002 > require "dbi" => false 1.9.2p180 :003 > require 'dbd-mysql' LoadError: no such file to load -- dbd-mysql from /.rvm/gems/ruby-1.9.2-p180@rails3/gems/dbi-0.4.5/lib/dbi.rb:318:in `rescue in load_driver' from /.rvm/gems/ruby-1.9.2-p180@rails3/gems/dbi-0.4.5/lib/dbi.rb:242:in `load_driver' from /.rvm/gems

Resque: one worker per queue

不打扰是莪最后的温柔 提交于 2019-12-03 13:17:54
I currently have a Rails 3.0 project, with Ruby 1.9.2 and Resque. My application has multiple worker classes and multiple queues, that are dynamically created (during runtime). Also, there are multiple workers started that are free to work on any queues, because at start time there isn't any existing queues, and they cannot be predicted: $ COUNT=3 QUEUE=* rake resque:workers Queues a created based on the project 's id: @queue = "project_#{project.id}".to_sym For a given queue, their jobs have to processed in order and one at a time. My problem is that, by having multiple workers, multiple jobs

load works on local path, require doesn't

拈花ヽ惹草 提交于 2019-12-03 04:40:50
loadee.rb puts '> This is the second file.' loaddemo.rb puts 'This is the first (master) program file.' load 'loadee.rb' puts 'And back again to the first file.' When I run "ruby loaddemo.rb" , This works fine. Both files are in the same directory, and that's the directory I run from. But if I change the load to a require, and with or without the extension I get: <internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- loadee.rb (LoadError) from <internal:lib/rubygems/custom_require>:29:in `require' from loaddemo.rb:2:in `<main>' My question is of course, why isn't

Neither ruby and nor irb can load .rb file in current directory

不羁岁月 提交于 2019-12-02 17:30:49
I'm having a really noob problem with importing files in Ruby. I'm making a Ruby app in Windows XP. All the class files for the app are in "C:/Documents/Prgm/Surveyor_Ruby/lib" . But when I require a file in another file, neither ruby nor irb can find the required file. The current directory's contents: C:\Documents\Prgm\Surveyor_Ruby\lib>dir Volume in drive C has no label. Volume Serial Number is AAAA-BBBB Directory of C:\Documents\Prgm\Surveyor_Ruby\lib 10/09/2010 06:32 PM <DIR> . 10/09/2010 06:32 PM <DIR> .. 10/08/2010 03:22 PM 5,462 main (commented).rb 10/08/2010 03:41 PM 92 question.rb 10

key in ruby new hash

て烟熏妆下的殇ゞ 提交于 2019-12-02 06:11:13
问题 There is a weird issue with Ruby 1.9.2's new hash syntax. How can I put any Object as key in hash in 1.9.2? in 1.8.7 hash it works: a="b" {"a" => "some",a => "another value",:a => "3rd value"} But in 1.9.2 > We can't (or how can we if I'm wrong?") 1.9.2 hash: {a: "some"} => {:a=>"s"} #it convert to old hash format but a="a" {a: "..."} # This doesn't work {"a": "some value"} => syntax error, unexpected '}', expecting $end from /home/naveed/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>' {1: