sinisterchipmunk / jax

Framework for creating rich WebGL-enabled applications using JavaScript and Ruby
http://jaxgl.com
MIT License
96 stars 16 forks source link

Undefined method `singleton_class' for JasmineRails:Module #74

Closed lutangar closed 11 years ago

lutangar commented 11 years ago

Hi there!

First of all, congratulations for this nice and tested webgl framework, I decided to play with this in the coming days. I'd like to send you a PR but I can't build nor test my modifications, I keep on getting the same error on rake: Undefined methodsingleton_class' for JasmineRails:Module`

I'm pretty sure it has something to do with the _activesupport as mentioned in https://github.com/sinisterchipmunk/jax/blob/master/lib/jax/engine.rb but I can't figure out how...

Here is the full stack trace :

sudo rake --trace
Resolving dependencies...
rake aborted!
undefined method `singleton_class' for JasmineRails:Module
/var/lib/gems/1.8/gems/railties-3.2.12/lib/rails/engine.rb:388:in `isolate_namespace'
/var/lib/gems/1.8/gems/jasmine-rails-0.3.2/lib/jasmine_rails/engine.rb:3
/var/lib/gems/1.8/gems/jasmine-rails-0.3.2/lib/jasmine-rails.rb:1:in `require'
/var/lib/gems/1.8/gems/jasmine-rails-0.3.2/lib/jasmine-rails.rb:1
/home/johan/Workspace/jax/lib/jax/engine.rb:2:in `require'
/home/johan/Workspace/jax/lib/jax/engine.rb:2
/home/johan/Workspace/jax/lib/jax.rb:3:in `require'
/home/johan/Workspace/jax/lib/jax.rb:3
/home/johan/Workspace/jax/Rakefile:17:in `require'
/home/johan/Workspace/jax/Rakefile:17
/var/lib/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load'
/var/lib/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:583:in `raw_load_rakefile'
/var/lib/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:89:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:88:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:72:in `run'
/var/lib/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/var/lib/gems/1.8/gems/rake-10.0.3/bin/rake:33
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19
sinisterchipmunk commented 11 years ago

Thank you for the report. Which version of Jax are you using? I have modified how Jax interfaces with Jasmine in master, but have not yet released the changes to rubygems.org. Could you try testing against the master branch in the git repo, and see if this is still an issue?

lutangar commented 11 years ago

In fact this test was already done on the master branch from github 3.0.0 RC2, and not in jax project. The gem I'm using also seems to be 3.0.0 RC2 Successfully installed jax-3.0.0.rc2. I'll try to dig deeper on that today.

Beside, if there is a way to test a jax project against a different jax version than the gem one, I'll be glad to know how to do so.

lutangar commented 11 years ago

Here is more,

First, the jax gem that was the very first installed was an older one, I was giving a try to the _gettingstarted and it seems, as you said, the version on rubygems wasn't the fresh one.

However, the undefined methodsingleton_class' for JasmineRails:Module` issue appeared as i tried to rake on a freshly forked branch from the master.

I tried to get rid off old dependencies for a fresh start :

gem clean
gem uninstall jasmine
gem uninstall jasmine-rails
gem uninstall jasmine-headless-webkit

Then did a new clone from the master

bundle install
sudo rake jasmine

In the end still stubbling upon the same issue...

As @Goutte did, I tried to test Jax Framework itself not my Jax based application.

As an answer to myself :

if there is a way to test a jax project against a different jax version than the gem one, I'll be glad to know how to do so.

Gemfile.lock

...
GIT
  remote: git://github.com/you/your_jax_fork.git
  revision: a73042129a17425d214dff6a3bd9a120fb7407ea 
  specs:
    jax (3.0.0.rc2)
      jasmine-rails
      jquery-rails
      rails (>= 3.1)
...
sinisterchipmunk commented 11 years ago

I just noticed you are trying to run rake jasmine. That's not the correct command. Try this: bundle exec rake server. Then you should be able to run the jasmine tests in a web browser by going to http://localhost:3000/jasmine/ .

If that does not help, can you also link to a gist of the entire contents of your Gemfile.lock ? Thanks!

BTW, the recommended way to control gem versions and repos is from the Gemfile like so:

gem "jax", "2.0.12"
gem "jax", "3.0.0.rc2"
gem "jax", git: "git://github.com/sinisterchipmunk/jax.git"
lutangar commented 11 years ago

bundle exec rake server

rake aborted!
undefined method `singleton_class' for JasmineRails:Module
...

Didnt help, anyway thank you for trying. It seems that either way to call rake, rake always fails.

Here is the Gemfile.lock of my jax fork.

BTW, the recommended way to control gem versions and repos is from the Gemfile

I am not familiar with Ruby, thanks for the tip!

sinisterchipmunk commented 11 years ago

I noticed from your initial stack trace, mentions of Ruby 1.8. What does ruby --version return, exactly?

You should be aware that Rails has stopped supporting anything older than Ruby 1.9.3 after v3.2. By necessity, since Jax depends on Rails, Jax will need to follow suit when the next version of Rails is released. v1.8.7 is still supported for the time being, however.

sinisterchipmunk commented 11 years ago

I was able to reproduce your issue under Ruby 1.8.7 and have committed a fix. Please see if it resolves your problem.

lutangar commented 11 years ago

I wont be able to check if your commit fixed my issue, but ruby 1.9 did!

Thank you for your time.

I'm ready to dive into the real stuff now.