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

opal-node can't find ./app.rb #3

Merged
merged 1 commit into from
Jan 23, 2013
Merged

opal-node can't find ./app.rb #3

merged 1 commit into from
Jan 23, 2013

Conversation

yhara
Copy link

@yhara yhara commented Jan 21, 2013

I tried opal-node with Node v0.8.17 and v0.9.7, but got the following error:

% cat app.rb
puts "hello"
% opal-node app.rb

module.js:340
    throw err;
          ^
Error: Cannot find module 'app.rb'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/opal/bin/opal-node:5:1)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)

When you call require("foo.rb"), Node will look for somewhere/node_modules/foo.rb.
This patch fixes bin/opal-node to expand the given path based on current working directory.

@elia
Copy link
Member

elia commented Jan 23, 2013

Thanks!

elia added a commit that referenced this pull request Jan 23, 2013
opal-node can't find ./app.rb
@elia elia merged commit c433843 into opal:master Jan 23, 2013
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.

2 participants