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 6972605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:59:28+00:00 2026-05-27T16:59:28+00:00

I broke it again and unfortunately I am not sure why… Problem first Using

  • 0

I broke it again and unfortunately I am not sure why…

Problem first

Using the .bash_profile that was created during RVM installation Git cannot be found. Adding back the old path exports from mac ports in the .profile breaks the rails server by reverting ruby back to 1.8.7

I think I identified

/opt/local/bin:
/opt/local/sbin:

to be the two directories in the .bash_profile that will make Git work but break the new RVM ruby verison.

Solution

So here the solution:
I am using a Mac Ports Git version. Thats why it won’t run, unless the Mac Ports directories are part of the path. When the Mac Ports directories are sourced after RVM the Mac Ports Ruby Version seem to take precedence over the RVM version.

This will break:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
export PATH=/opt/local/bin:/opt/local/sbin:$PATH

This will work:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

Thanks @three for pointing me in the right direction 🙂

How I broke it

Juggeling Ruby and Rails versions around to be in sync with the tutorials I am doing to learn the two, the name RVM kept popping up as a tool to manage those versions more conveniently.

I installed it and and got it to work

ruby -v
$ ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]

rails -v
$ Rails 3.1.3

In the process my .profile started failing, but I think that is because of the precedence of the .bash_profile that was created during the RVM installation. I was expecting trouble but all good so far and everything working, including the rails server.

rails s
=> Booting WEBrick
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-12-19 10:16:15] INFO  WEBrick 1.3.1
[2011-12-19 10:16:15] INFO  ruby 1.9.2 (2011-07-09) [x86_64-darwin10.8.0]
[2011-12-19 10:16:15] INFO  WEBrick::HTTPServer#start: pid=53018 port=3000

Then I wanted to commit to Git, but that all of a sudden doesn’t work anymore

git
-bash: git: command not found

So I compared the .profile and .bash_profile found that Mac Ports added a line of code to the .profile when initially installing ruby, rails and git (sure 100% I used MacPorts for all three)

##
# Your previous /Users/username/.profile file was backed up as /Users/username/.profile.macports-saved_2011-10-19_at_08:48:41
##

# MacPorts Installer addition on 2011-10-19_at_08:48:41: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

If I query the ruby version with this setting I get:

ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10]

So my newbie guess is I broke the path variable in the process of installing RVM. If I add the line to the .bash_profile git works again, but the rails server doesn’t. Notice the ruby version missmatch.:

rails s
/Users/username/.rvm/gems/ruby-1.9.2-p290/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10]

Abort trap

The contents of my $PATH when using the Mac Ports PATH exports is:

echo $PATH
/opt/local/bin:
/opt/local/sbin:
/Users/username/.rvm/gems/ruby-1.9.2-p290/bin:
/Users/username/.rvm/gems/ruby-1.9.2-p290@global/bin:
/Users/username/.rvm/rubies/ruby-1.9.2-p290/bin:
/Users/username/.rvm/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/usr/local/bin:
/usr/X11/bin:

On the other hand using the .bash_profile as is this is the $PATH contents:

echo $PATH
/Users/username/.rvm/gems/ruby-1.9.2-p290/bin:
/Users/username/.rvm/gems/ruby-1.9.2-p290@global/bin:
/Users/username/.rvm/rubies/ruby-1.9.2-p290/bin:
/Users/username/.rvm/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/usr/local/bin:
/usr/X11/bin:

Looks pretty similar, except for those two directories:

/opt/local/bin:
/opt/local/sbin:

So my guess is, thats where it breaks… But I have no idea what to do about it.

I am still so new to all of this development, Apple Computers, Unix, Ruby, Rails Stuff 🙁

Any help is greatly appreciated.

Thanks
TIM

  • 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-05-27T16:59:29+00:00Added an answer on May 27, 2026 at 4:59 pm

    put the RVM line after the export PATH for macports so that the rvm binaries for ruby will take precendence

    export PATH=/opt/local/bin:/opt/local/sbin:$PATH
    [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
    

    Also consider using homebrew instead of macports which is the much slicker version of maintaining *nix tools.

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

Sidebar

Related Questions

This was working just fine, not sure what broke it, but now I'm getting
EDIT: It turns out that the problem was with an input parm. Apparently, if
EDIT: This is not a problem with the jQuery creating the appropriate markup from
Autotest broke with rspec-rails 2.2.1 update. Now I can't get it working again.. .even
I'm not sure what is happening with this app. It worked fine then one
I am using RVM and have installed rails 3.1.0 multiple times but once I
I've been using LuaInterface and Lua 5.1 in several C# applications that required scripting,
I just spent a half hour debugging some new code that's not broken because
I've seen a few similar posts to my problem, but none that have helped
I broke my left collarbone and my left hand completely immobilized so I can

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.