Error Running Application with rbenv, undefined local variable or method `e' for main:Object (NameError)

I'm trying to run a sinatra app within ruby mine.  I recently switched from rvm to rbenv.  I'm trying to get the application running via thin through the rubymine interface, and I'm running into trouble.

To start, the application starts on the command line using bundle exec.

Inside Rubymine, I've added the 1.9.3 SDK to the project via preferences.

I've setup the Run/Debug configurations as follows:
- Setup a Ruby Run Configuration
Ruby Script: /Users/me/.rbenv/shims/thin
Script Arguments: -p 8666 -R start
Working Directory: /Users/me/gitcode/webapps/cal
Environment Variables: <blank>
Ruby arguments: -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)
Ruby SDK: Use Project Default SDK: ruby-1.9.3-p194

On the Bundler Tab:
Run the script in the context of the bundle (bundle exec) is selected.

When I try and run this configuration, I get the following error.

/Users/me/.rbenv/versions/1.9.3-p194/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/me/.rbenv/shims/thin -p 8666 -R start
/Users/me/.rbenv/shims/thin:2:in `<top (required)>': undefined local variable or method `e' for main:Object (NameError)
    from -e:1:in `load'
    from -e:1:in `<main>'

Process finished with exit code 1

I can't seem to figure out what is causing the error.  Something about -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) seems to be bombing, but I'm not sure how to trouble shoot it.  Or if it's a different problem related to the setup of rbenv.

Please let me know if any more information will help.


1 comment
Comment actions Permalink

Hi Myles,

unfortunately I do not have rbenv to try to reproduce the problem, but I'd suggest to run the command from shell to see if it works,
also you could try to debug the problem in RM (just set breakpoint to the filrst line of thin to see what's wrong there)

Hope this helps, Oleg.

P.S. in case it is not feel free to ask more questions and I will try to find place to setup rbenv and play with it :)


Please sign in to leave a comment.