Question: Background: I am on a mac os X. I installed ruby 2.2.4 using RVM.

When I try to bundle install I get the following error:

```
-bash: /usr/bin/bundle: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory

```

`which ruby` returns `.../.rvm/rubies/ruby-2.2.4/bin/ruby`.

`whereis ruby` returns `/usr/bin/ruby`

I looked online for a solution and the editing the line of brew.rb from 1.8 to Current is not to be found anywhere. Maybe this file has changed.

I tried the brew update with no luck as well. Any clue what the issue is?

Answer: 
This 

```
@if (HttpContext.Current.Session["UserId"].ToString() != null && 
     HttpContext.Current.Session["UserId"].ToString() != "")

```

should be replaced with 

```
@if (HttpContext.Current.Session["UserId"] != null &&
...

```

The problem in your code is that `.ToString()` can only be called on a non-null reference and your code doesn't prevent this at the moment.
Remove ".ToString()" in the if condition. Session variable is already a string. Just use, HttpContext.Current.Session["UserId"]

Since the session variable is null, when you try to do ToString, it throws the null exception.