react.rb icon indicating copy to clipboard operation
react.rb copied to clipboard

Change ./ext/string requires to react/ext/string

Open makevoid opened this issue 10 years ago • 4 comments

I've found that there is a require error trying to bundle the code if the the ext/string path is not absolute (gem dir / path)

I think it works well when you are requiring the gem via path: "./.." like you do in the examples (in fact they work) but it breaks otherwise

fiy I'm on 2.1.6

Here's how to reproduce:

Gemfile

source "http://rubygems.org"

gem "react.rb", github: "zetachang/react.rb"

build.rb

require 'bundler'
Bundler.require

Opal::Builder.build('react')

run:

bundle && ruby build.rb

this pr should fix it

there is also some whitespace removal, If you want I can take it out from this PR and have just the two require lines as modified

also, very cool library! I will start to play with it soon! thanks!

makevoid avatar Aug 07 '15 13:08 makevoid

@makevoid can you paste the error you're getting after bundle && ruby build.rb?

elia avatar Aug 07 '15 13:08 elia

sure!

makevoid@mknix:~/apps/react-rb-builder$ ruby build.rb 
/usr/local/lib/ruby/gems/2.1.0/gems/opal-0.6.3/lib/opal/builder.rb:63:in `find_asset': Could not find asset: ./ext/string (RuntimeError)
    from /usr/local/lib/ruby/gems/2.1.0/gems/opal-0.6.3/lib/opal/builder.rb:39:in `require_asset'
    from /usr/local/lib/ruby/gems/2.1.0/gems/opal-0.6.3/lib/opal/builder.rb:83:in `block in compile_ruby'
    from /usr/local/lib/ruby/gems/2.1.0/gems/opal-0.6.3/lib/opal/builder.rb:82:in `each'
    from /usr/local/lib/ruby/gems/2.1.0/gems/opal-0.6.3/lib/opal/builder.rb:82:in `compile_ruby'

here's the full repo https://github.com/makevoid/react-rb-builder you can switch from the fixed to the original version by changing the file

makevoid avatar Aug 07 '15 13:08 makevoid

I had errors due to the same require. Manually requiring 'react/ext/string' fixed them for now, but imho this pr should be merged.

ahti avatar Sep 22 '15 03:09 ahti

This issue was moved to reactrb/reactrb#55

sollycatprint avatar Jun 10 '16 20:06 sollycatprint