1

I just tried rails inside a tmux session in iTerm2 and it returns as

-bash: /usr/bin/rails: /usr/bin/ruby: bad interpreter: No such file or directory

I can run rails outside of tmux . I am using Mac OSX. I've installed Ruby via RVM . Here's the output of ruby -v

ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.3.0]

and which ruby

/Users/user/.rvm/rubies/ruby-1.9.3-p392/bin/ruby

It's the same output for both inside tmux and normal bash shell.

Here's my ~/.tmux.conf

set -g default-terminal "screen-256color"

How am I able to run rails inside the tmux session?

Ye Lin Aung
  • 5,700

1 Answers1

2

Ensure that the bash session inside tmux is running as an interactive shell; the -i option to bash will start it in this mode. If I recall correctly, the RVM script runs from .bashrc, which is only executed for interactive shells; since it's the RVM script which adds ~/.rvm/... to your path, if it's not running, then bash will not be looking in the right place for the Ruby interpreter.

Aaron Miller
  • 10,087