Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9081213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:15:44+00:00 2026-06-16T20:15:44+00:00

I wrote a script todo.rb , whose first line is #!/usr/bin/env ruby . However,

  • 0

I wrote a script todo.rb, whose first line is #!/usr/bin/env ruby. However, running this script gives the following error:

λ ~/ ruby todo/todo.rb 
/Users/xjia/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- highline/import (LoadError)
    from /Users/xjia/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from todo/todo.rb:6:in `<main>'

I have already installed the gem highline:

λ ~/ which gem
/Users/xjia/.rvm/rubies/ruby-1.9.3-p0/bin/gem
λ ~/ gem install highline
Successfully installed highline-1.6.15
1 gem installed
Installing ri documentation for highline-1.6.15...
Installing RDoc documentation for highline-1.6.15...
λ ~/ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-darwin11.2.0]
  - INSTALLATION DIRECTORY: /Users/xjia/.rvm/gems/ruby-1.9.3-p0
  - RUBY EXECUTABLE: /Users/xjia/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/xjia/.rvm/gems/ruby-1.9.3-p0/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
  - GEM PATHS:
     - /Users/xjia/.rvm/gems/ruby-1.9.3-p0
     - /Users/xjia/.rvm/gems/ruby-1.9.3-p0@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

and I can require it in irb:

λ ~/ which irb
/Users/xjia/.rvm/rubies/ruby-1.9.3-p0/bin/irb
λ ~/ irb
irb(main):001:0> require 'highline/import'
=> true

However, require in ruby fails exactly the same:

λ ~/ which ruby
ruby: aliased to bundled_ruby
λ ~/ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
λ ~/ ruby -e "require 'highline/import'"
/Users/xjia/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- highline/import (LoadError)
    from /Users/xjia/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from -e:1:in `<main>'

I’m using rvm under both Ubuntu and Mac OS X. From my Ubuntu box, this shebang line works fine. However, it sucks under OS X. So what’s the reliable way to find out the usable ruby?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:15:45+00:00Added an answer on June 16, 2026 at 8:15 pm

    The problem is here:

    λ ~/ which ruby
    ruby: aliased to bundled_ruby

    you need to check:

    which bundled_ruby
    

    and make sure it also has proper shebang:

    #!/usr/bin/env ruby
    

    finally removing the alias for ruby should solve the problem, you might want check my gem rubygems-bundler which is by default installed with RVM – it provides more “intelligent” means of detecting and using bundler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote this script which counts occurrences of particular pattern in a given file.
I wrote this script to for a contact form on my website, everything works
I wrote the following script. My intention was to do the two following things:
I wrote this script https://gist.github.com/1313611 to ease my installs for rvm. The whole script
I have wrote a script to do some backup. There is a if block
I wrote a simple script that is intended to do hierarchical clustering on a
I wrote some script in a site. The script makes a new spreadsheet and
I wrote a script parsing a .csv file in groovy using tokenize, which ended
I wrote a script that uses xcodebuild to generate an AdHoc build of an
This was my first go at writing some jQuery code completely from scratch, so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.