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: 
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.
Here is one of possible decisions:

```
@if(!String.IsNullOrEmpty((string)HttpContext.Current.Session["UserName"]))
{
using (Html.BeginForm("Logout", "Login", FormMethod.Post, new { id="logoutForm", @class = "navbar-centre" }))
{
<table align="right">
<tr>
<td> Welcome : @Session["UserName"] !!</td>
                                                                                       </tr>
</table>
<a href="javascript:document.getElementById('logoutForm').submit()">Log off</a>
}
else
{
 <ul class="nav navbar-nav navbar-right">
        <li>@Html.ActionLink("Register", "Register", "Home", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
        <li>@Html.ActionLink("Log in", "Login", "Home", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
    </ul>
}

```

Make these changes in your layout page.