Comments (14)
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.
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.
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.
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.
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.
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.
RVM had this issue too, a while back https://gist.github.com/842807. Still investigating.
from rbenv.
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.
I'd like to figure out why it works for me but not you.
from rbenv.
Is your /Users/justin/.rbenv/versions/jruby-1.6.4/bin/jruby
a binary file or a bash script?
from rbenv.
~$ head -n 1 ~/.rbenv/versions/jruby-1.6.4/bin/jruby
#!/usr/bin/env bash
from rbenv.
Do you have any suggestions or things to try?
from rbenv.
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.
Weird. Glad you were able to fix it though. Thanks for helping me debug.
from rbenv.
Related Issues (20)
- rbenv commands do nothing (e.g. install) HOT 4
- GRPC in nix does not work
- Helpful install message HOT 3
- Ubuntu 22 - no ruby 3.1.2 HOT 2
- clearer feedback message needed after running rbenv init HOT 1
- Question: why rbenv recommends inserting initial command to `~/.zshrc` instead of `~/.zshenv` or `~/.zprofile` ? HOT 2
- rbenv 1.2.0 (from Homebrew) not installing versions to ~/.rbenv/versions on Mac OS Ventura HOT 2
- Error installing mini_racer: ERROR: Failed to build gem native extension HOT 2
- Windows with WSL2 manual git clone installation method, wrong line endings HOT 4
- `rbenv init` fails in parallel environment HOT 2
- rbenv-doctor script fails: `printc:3: bad substitution` HOT 2
- version `GLIBC_2.38' not found HOT 2
- `rbenv doctor` warns about multiple paths, one symlinks to the other HOT 1
- homebrew ruby: gem command not found
- Multiple instances of rbenv-install HOT 2
- `gem-rehash` inop for `bundle install`
- GOV UK
- rbenv breaks non-interactive shells when switching user and installing version
- Shim doesn't work for Ruby 3.3.0 HOT 5
- Error when use "gem" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rbenv.