# Where can I find the 'shebang' line?

**URL:** <https://www.ruby-forum.com/t/where-can-i-find-the-shebang-line/192286>\
**Category:** Ruby\
**Created:** [July 27, 2010, 7:10pm UTC](https://www.ruby-forum.com/t/where-can-i-find-the-shebang-line/192286 "2010-07-27T19:10:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@ast](https://www.ruby-forum.com/u/ast)\
**Post date:** [July 27, 2010, 7:10pm UTC](https://www.ruby-forum.com/t/where-can-i-find-the-shebang-line/192286/1 "2010-07-27T19:10:46Z")

</div>

I seem to be having trouble with RVM (after an update to Rails 3 RC),  
where when I do a:

rake db:migrate

I am given the error:

* * *

/Users/me/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.1/lib/sqlite3/sqlite3\_native.bundle:  
[BUG] Segmentation fault  
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

## Abort trap

rails -v shows:

Rails 3.0.0.rc

and ruby -v shows:

ruby 1.9.2dev (2010-07-24 revision 28749) [x86\_64-darwin10.4.0]

I noticed via a google search that this works:

rvm 1.9.2-head rake db:migrate

And they also mentioned to check the ‘shebang line’ because “My guess  
would be that the shebang line of the rake / binary is set somehow to  
1.8.7.”  
([http://groups.google.com/group/rubyversionmanager/browse\_thread/thread/ea9b2fc038d30dad](http://groups.google.com/group/rubyversionmanager/browse_thread/thread/ea9b2fc038d30dad))

Any idea where I can find the shebang line, or sort this problem out?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@ast](https://www.ruby-forum.com/u/ast)\
**Post date:** [July 27, 2010, 8:35pm UTC](https://www.ruby-forum.com/t/where-can-i-find-the-shebang-line/192286/2 "2010-07-27T20:35:50Z")

</div>

On Tue, Jul 27, 2010 at 12:10 PM, Ast J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]  
> ruby 1.9.2dev (2010-07-24 revision 28749) [x86\_64-darwin10.4.0]  
> Any idea where I can find the shebang line, or sort this problem out?
> 
> Thanks in advance.

The shebang line is (optionally) the first line of a Unix script,  
starting with #!. It tells the OS what interpreter to use to run the  
script, and what arguments to pass to it. In this case, you should  
check to see which ruby interpreter version is named in the #! line of  
rake (which you can find by typing which rake).

---

<div class="post-metadata">

**Author:** ![ast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@ast](https://www.ruby-forum.com/u/ast)\
**Post date:** [July 27, 2010, 9:08pm UTC](https://www.ruby-forum.com/t/where-can-i-find-the-shebang-line/192286/3 "2010-07-27T21:08:59Z")

</div>

Eric C. wrote:

> The shebang line is (optionally) the first line of a Unix script,  
> starting with #!. It tells the OS what interpreter to use to run the  
> script, and what arguments to pass to it. In this case, you should  
> check to see which ruby interpreter version is named in the #! line of  
> rake (which you can find by typing which rake).

Thanks for your help Eric 🙂

The first line of that file reads:

#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

I’ve looked in /Versions and it only has a folder for 1.8 (guess because  
I am using RVM?)

Any ideas what I can do to fix this?

---

<div class="post-metadata">

**Author:** ![ast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@ast](https://www.ruby-forum.com/u/ast)\
**Post date:** [July 27, 2010, 9:36pm UTC](https://www.ruby-forum.com/t/where-can-i-find-the-shebang-line/192286/4 "2010-07-27T21:36:17Z")

</div>

I fixed it!

Just added this to the shebang instead:

/Users/me/.rvm/rubies/ruby-1.9.2-head/bin/ruby

And that works 🙂

Thanks for the help Eric!

---

<div class="post-metadata">

**Author:** ![ast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@ast](https://www.ruby-forum.com/u/ast)\
**Post date:** [July 27, 2010, 10:13pm UTC](https://www.ruby-forum.com/t/where-can-i-find-the-shebang-line/192286/5 "2010-07-27T22:13:37Z")

</div>

On Tue, Jul 27, 2010 at 2:36 PM, Ast J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I fixed it!
> 
> Just added this to the shebang instead:
> 
> /Users/me/.rvm/rubies/ruby-1.9.2-head/bin/ruby
> 
> And that works 🙂
> 
> Thanks for the help Eric!

No problem. Out of curiosity, where was rake located? Since it was  
using the system 1.8.7 Ruby, I wonder if it was also installed in a  
system location.

---

<div class="post-metadata">

**Author:** ![ast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@ast](https://www.ruby-forum.com/u/ast)\
**Post date:** [July 27, 2010, 11:20pm UTC](https://www.ruby-forum.com/t/where-can-i-find-the-shebang-line/192286/6 "2010-07-27T23:20:47Z")

</div>

Eric C. wrote:

> No problem. Out of curiosity, where was rake located? Since it was  
> using the system 1.8.7 Ruby, I wonder if it was also installed in a  
> system location.

Hi Eric, it was in:

/Users/me/.rvm/gems/ruby-1.9.2-head/bin/rake

Wonder why it was going for the non-rvm location? Started happening  
after I upgraded to Rails 3RC :-/
