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

jruby+truffle setup creates gems in 'ruby' directory but jruby looks in 'jruby' directory #3569

Closed
tinco opened this issue Dec 28, 2015 · 6 comments
Assignees
Milestone

Comments

@tinco
Copy link

tinco commented Dec 28, 2015

When running a truffle project I get the following exception:

  cannot load such file -- rack (LoadError)

Steps to reproduce:

  1. Add a Gemfile to project, enter 'rack' gem
  2. Run jruby+truffle setup, it should create a .jruby+truffle_bundle/ruby directory
  3. Add a ruby file that does require 'rack'
  4. Have a wrapper around jruby nightly like so: echo 'exec /jruby-master/bin/jruby -X+T -r "./.jruby+truffle_bundle/bundler/setup.rb" "$@"' > /jruby-master/bin/ruby && chmod +x /jruby-master/bin/ruby
  5. Use it to run the ruby file, see the error
  6. Rename the gem directory to jruby, error should disappear

I wrote these steps from heart, it might be that I missed something crucial. There's a docker environment that had the problem here: phusion/truffle-test@6395e74

@chrisseaton
Copy link
Contributor

I believe this happens because the tool is being run by a system Ruby rather than JRuby - but the tool shouldn't let that happen.

As @tinco says the workaround is to rename .jruby+truffle_bundle/ruby to .jruby+truffle_bundle/jruby, but there may be other symptoms of the system Ruby being used to run the tool, such as the wrong version of gems being installed.

Ping @pitr-ch

@chrisseaton chrisseaton added this to the truffle-dev milestone Dec 28, 2015
@pitr-ch
Copy link
Member

pitr-ch commented Jan 4, 2016

Hello @tinco,
let my try to help, couple of questions first:

(2.) how do you run jruby+truffle setup ? I couldn't find it in the Dockerfile.
(4.) why wrapper is used instead of jruby+truffle run a_file.rb ?

I've tried to reproduce your steps (without docker) but the wrapper worked for me in setup environment.

@pitr-ch
Copy link
Member

pitr-ch commented Jan 4, 2016

Ah, @nirvdrum helped me to figure out why do you see ruby instead of jruby, fix is coming. For now switching your env. to jruby-master before running jruby+truffle setup should help.

@pitr-ch
Copy link
Member

pitr-ch commented Jan 4, 2016

jruby+truffle setup is fixed to use correct bundler.

@tinco
Copy link
Author

tinco commented Jan 5, 2016

Good work and thanks 👍

@chrisseaton
Copy link
Contributor

Can this be closed?

@tinco tinco closed this as completed Jan 10, 2016
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
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

No branches or pull requests

4 participants