Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

makevoid
Copy link

@makevoid makevoid commented Aug 7, 2015

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!

@elia
Copy link
Collaborator

elia commented Aug 7, 2015

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

@makevoid
Copy link
Author

makevoid commented Aug 7, 2015

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

@ahti
Copy link

ahti commented Sep 22, 2015

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

@sollycatprint
Copy link

This issue was moved to ruby-hyperloop/hyper-react#55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants