Code Monkey home page Code Monkey logo

Comments (14)

jmazzi avatar jmazzi commented on May 13, 2024

This might provide some insight http://twitter.com/headius/status/111179885497679873

"Perhaps rbenv doesn't properly handle the fact that (ba)sh scripts can't shebang to other (ba)sh scripts."

from rbenv.

sstephenson avatar sstephenson commented on May 13, 2024

Seems to be working fine here:

~$ rbenv version
jruby-1.6.4 (set by RBENV_VERSION environment variable)
~$ ruby --version
jruby 1.6.4 (ruby-1.8.7-p330) (2011-08-23 17ea768) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_26) [darwin-x86_64-java]
~$ gem install bundler
Fetching: bundler-1.0.18.gem (100%)
Successfully installed bundler-1.0.18
1 gem installed
~$ rbenv rehash
~$ bundle
Could not locate Gemfile

from rbenv.

jmazzi avatar jmazzi commented on May 13, 2024

Weird. When I execute it directly it works fine


➜  helix git:(develop) ✗ bundle          
/Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle: line 9: require: command not found
/Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle: line 11: version: command not found
/Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle: line 13: syntax error near unexpected token `('
/Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle: line 13: `if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then'
➜  helix git:(develop) ✗ exec -a bundle /Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle
Fetching source index for http://rubygems.org/

from rbenv.

jmazzi avatar jmazzi commented on May 13, 2024

Well, it works fine in zsh. Here is what happens I startup a default bash session


bash-3.2$ export PATH=$PATH:$HOME/.rbenv/bin
bash-3.2$ eval "$(rbenv init -)"
bash-3.2$ export RBENV_VERSION=jruby-1.6.4
bash-3.2$ bundle
/Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle: line 9: require: command not found
/Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle: line 11: version: command not found
/Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle: line 13: syntax error near unexpected token `('
/Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle: line 13: `if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then'
bash-3.2$ exec -a bundle /Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle
/Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle: line 9: require: command not found
/Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle: line 11: version: command not found
/Users/justin/.rbenv/versions/jruby-1.6.4/bin/bundle: line 13: syntax error near unexpected token `('

from rbenv.

jmazzi avatar jmazzi commented on May 13, 2024

Does your bundle look like this?


bash-3.2$ which bundle
/Users/justin/.rbenv/shims/bundle
bash-3.2$ cat `which bundle`
#!/usr/bin/env bash
set -e
exec rbenv exec "${0##*/}" "$@"
bash-3.2$ 

from rbenv.

sstephenson avatar sstephenson commented on May 13, 2024

Yes, my bundle looks the same. I'm using bash, not zsh.

~$ $SHELL --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)
Copyright (C) 2007 Free Software Foundation, Inc.

from rbenv.

jmazzi avatar jmazzi commented on May 13, 2024

RVM had this issue too, a while back https://gist.github.com/842807. Still investigating.

from rbenv.

jmazzi avatar jmazzi commented on May 13, 2024

Changing the shebang to #!/usr/bin/env /Users/justin/.rbenv/versions/jruby-1.6.4/bin/jruby fixes this problem for me.

Interestingly enough, /Users/justin/.rbenv/versions/jruby-1.6.4/bin/jruby itself is also a bash script. I bet if this was a binary file it would work fine.

from rbenv.

sstephenson avatar sstephenson commented on May 13, 2024

I'd like to figure out why it works for me but not you.

from rbenv.

jmazzi avatar jmazzi commented on May 13, 2024

Is your /Users/justin/.rbenv/versions/jruby-1.6.4/bin/jruby a binary file or a bash script?

from rbenv.

sstephenson avatar sstephenson commented on May 13, 2024
~$ head -n 1 ~/.rbenv/versions/jruby-1.6.4/bin/jruby
#!/usr/bin/env bash

from rbenv.

jmazzi avatar jmazzi commented on May 13, 2024

Do you have any suggestions or things to try?

from rbenv.

jmazzi avatar jmazzi commented on May 13, 2024

rm -f ~/.rbenv/shims/* && rbenv rehash fixed it for me. Previous to running this I ran rbenv rehash multiple times without any improvement.

I suppose it's possible that the ruby-build PREFIX bug yesterday could have caused some weirdness with my shims.

from rbenv.

sstephenson avatar sstephenson commented on May 13, 2024

Weird. Glad you were able to fix it though. Thanks for helping me debug.

from rbenv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.