Giter Site home page Giter Site logo

Comments (9)

peterzhao avatar peterzhao commented on August 26, 2024

I got the same issue.

from jasmine-gem.

nieve avatar nieve commented on August 26, 2024

ok, at home I've got version 1.0.2.1 which works, but I also have rails 2.3.8, so I'm not sure whether this is a bug or not...

from jasmine-gem.

peterzhao avatar peterzhao commented on August 26, 2024

I traced the issue and found the following code in lib/jasmine/base.rb which cause the issue:

begin
Gem::Specification::find_by_name "rails", ">= 3.0"
rescue
Gem.available? "rails", ">= 3.0"
end

Line 51 ' Gem::Specification::find_by_name "rails", ">= 3.0"' will throw exception. However ruby 1.9.2p290 begin/rescue does not work and the exception will bubble up and cause 'require "jasmine"' failure. Very strange behaviour of ruby! This issue cannot be noticed on ruby 1.9.2p180.

from jasmine-gem.

peterzhao avatar peterzhao commented on August 26, 2024

found the solution to fix the issue:

def self.rails3?
return Rails.version.split(".").first.to_i == 3 if defined? Rails
begin
Gem::Specification::find_by_name "rails", ">= 3.0"
rescue Gem::LoadError
false
rescue
Gem.available? "rails", ">= 3.0"
end
end

need rescue Gem::LoadError exception! Will post the patch.

from jasmine-gem.

nieve avatar nieve commented on August 26, 2024

Peter- brilliant stuff!! thanks a lot, appreciate that :)

from jasmine-gem.

ragaskar avatar ragaskar commented on August 26, 2024

Hey, thanks for this; we've had this problem reported but haven't been able to repro it. I'm on vacation at the moment (coming to you courtesy of satellite from the New Mexico mountains), but I will merge a fix for this ASAP as soon as I'm back (later this week). I just need to test that any fix stays compatible with previous Rubygem versions.

from jasmine-gem.

laripk avatar laripk commented on August 26, 2024

Just wanted to note that I have this problem too (sinatra application, ruby 1.9.2p180 [contrasting with peterzhao's statement], jasmine 1.1.0), and came up with a similar fix. Looking forward to the patch merge.

from jasmine-gem.

ragaskar avatar ragaskar commented on August 26, 2024

I believe this should be fixed with the merging of #56 into the jasmine 1.1.1 gem. Let me know if you're still seeing issues.

from jasmine-gem.

mraaroncruz avatar mraaroncruz commented on August 26, 2024

Could you push this to rubygems. I just spent a bunch of time trying to debug this, then luckily found this thread.
This fix is working for me.
Thanks!

from jasmine-gem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.