I just bought the new Mac app CodeRunner, which is really very cool. If you haven't seen it, do give it a look, because it allows you to run a whole lot of different languages' scripts directly in an editor/console environment and get the results from your snippet.
However, I can't seem to get it to play correctly with RVM.
Has anyone here had any experience with this combination yet? Any tips? Yes, I did try putting my RVM path into the preferences (and a shebang), but that didn't have any noticeable effect. It seems to be running everything through a /Library/Ruby/Site/1.8/rubygems when I `require 'rubygems'` and from there on, it just gets everything wrong.
hello, you can change the Languages preferences 'Run Command' from:
ruby $filename
to:
[[ -s /Users/__yourname__/.rvm/scripts/rvm ]] && source
/Users/__yourname__/.rvm/scripts/rvm && ruby $filename
hello, you can change the Languages preferences 'Run Command' from:
ruby $filename
to:
[[ -s /Users/__yourname__/.rvm/scripts/rvm ]] && source
/Users/__yourname__/.rvm/scripts/rvm && ruby $filename
pls change __yourname__ to your home folder name
That's not working here. I get no output other than Run Failed. If I pull it back to ruby $filename, I at least get an error message, and I get the same error message if I put an explicit path to the rvm-installed ruby in place of the bare word ruby. (It's running the correct ruby in either case.)
<updated rvm to very latest version, using your run command unedited gives me:>
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
/Users/waltd/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- nokogiri (LoadError)
from /Users/waltd/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from test.rb:2
Line 2 of my test script is simply require 'nokogiri' (and line 1 is require 'rubygems'). gem list shows Nokogiri 1.5.0 installed and working (it works in other scripts or irb).
Yes, and yes, I already tried that first. I get the correct ruby in any script I run in there, but I don't see the nokogiri gem, even though it's listed correctly in gem list.
The issue I am trying to solve is the gem loading. If I want to run a simple snippet such as the one you showed, I agree, it works perfectly. But anything fancier than that fails. I can load a standard library like Time, but anything from gem (besides rubygems itself) seems to fail.
New version of CodeRunner just released through the MAS, it works perfectly with gems and RVM, with no fussing in the path preferences. I edited it back to 'ruby $filename' and all's right with the world.
Unfortunately, the new version of CodeRunner Will still output the error
message 'tput: No value for $TERM and no -T specified', if you update
the RVM to 1.10.1
the new version of CodeRunner now can recognition of user's PATH
variables, so I edited the Run Command back to 'ruby $filename', but
when I run ruby code it's still output the message. and it causes the
problem in all other languages snippets output, etc the Python,
ObjectiveC. Then, I try to edit my ~/.profile to add the prefixes to
RVM's config.
before the change: