# CodeRunner and RVM

**URL:** <https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919>\
**Category:** rubyonrails-talk\
**Tags:** off-topic\
**Created:** [December 7, 2011, 3:48pm UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919 "2011-12-07T15:48:18Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![walterdavis](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/walterdavis/32/705_2.png) [@walterdavis](https://discuss.rubyonrails.org/u/walterdavis)\
**Post date:** [December 7, 2011, 3:48pm UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/1 "2011-12-07T15:48:18Z")

</div>

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.

Thanks,

Walter

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [January 11, 2012, 3:54am UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/2 "2012-01-11T03:54:10Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![walterdavis](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/walterdavis/32/705_2.png) [@walterdavis](https://discuss.rubyonrails.org/u/walterdavis)\
**Post date:** [January 11, 2012, 5:24pm UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/3 "2012-01-11T17:24:39Z")

</div>

> 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) &nbsp;&nbsp;from /Users/waltd/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' &nbsp;&nbsp;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).

Walter

---

<div class="post-metadata">

**Author:** ![Michal\_Papis](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/michal_papis/32/10541_2.png) [@Michal\_Papis](https://discuss.rubyonrails.org/u/Michal_Papis)\
**Post date:** [January 11, 2012, 6:58pm UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/4 "2012-01-11T18:58:22Z")

</div>

are you sure you run stable rvm ?

&nbsp;&nbsp;&nbsp;&nbsp;rvm get stable

also you can use one of rubies listed by:

&nbsp;&nbsp;&nbsp;&nbsp;ls -1 $rvm\_path/wrappers/\*/ruby

just put the full path instead of ruby in the 'Run Command':

&nbsp;&nbsp;&nbsp;&nbsp;ruby $filename

---

<div class="post-metadata">

**Author:** ![walterdavis](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/walterdavis/32/705_2.png) [@walterdavis](https://discuss.rubyonrails.org/u/walterdavis)\
**Post date:** [January 11, 2012, 8:43pm UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/5 "2012-01-11T20:43:45Z")

</div>

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.

Walter

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [January 12, 2012, 11:07am UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/6 "2012-01-12T11:07:52Z")

</div>

It's seem to the latest version of rvm (1.10.1) has some problem, you can install the 1.10.0 version through the command:

rvm get 1.10.0

then try to re-run your code snippets.

sorry for my bad english, i am a chinese.

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [January 12, 2012, 1:12pm UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/7 "2012-01-12T13:12:12Z")

</div>

Version 1.10.1 of RVM can also work, but it will output the error message: 'tput: No value for $TERM and no -T specified', at the console's top.

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [January 12, 2012, 1:37pm UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/8 "2012-01-12T13:37:35Z")

</div>

with 1.10.1

Attachments: [http://www.ruby-forum.com/attachment/6897/Untitled.rb.jpg](http://www.ruby-forum.com/attachment/6897/Untitled.rb.jpg)

---

<div class="post-metadata">

**Author:** ![walterdavis](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/walterdavis/32/705_2.png) [@walterdavis](https://discuss.rubyonrails.org/u/walterdavis)\
**Post date:** [January 12, 2012, 5:33pm UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/9 "2012-01-12T17:33:19Z")

</div>

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.

Walter

---

<div class="post-metadata">

**Author:** ![walterdavis](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/walterdavis/32/705_2.png) [@walterdavis](https://discuss.rubyonrails.org/u/walterdavis)\
**Post date:** [January 12, 2012, 10:57pm UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/10 "2012-01-12T22:57:32Z")

</div>

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.

Walter

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [January 13, 2012, 12:42am UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/11 "2012-01-13T00:42:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [January 13, 2012, 1:27am UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/12 "2012-01-13T01:27:29Z")

</div>

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:

[[-s /Users/scriptfans/.rvm/scripts/rvm]] && source /Users/scriptfans/.rvm/scripts/rvm

after try to run the `echo $TERM` command in the Terminal, i see the output is `xterm-256color`, so i change the config to:

[[-s /Users/scriptfans/.rvm/scripts/rvm]] && source TERM=xterm-256color /Users/scriptfans/.rvm/scripts/rvm

and all's right with the world.

But is that correct? will have any side effects? I'm not sure.

I think this is a RVM's bug, because the old version is no problem.

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [January 13, 2012, 1:43am UTC](https://discuss.rubyonrails.org/t/coderunner-and-rvm/61919/13 "2012-01-13T01:43:37Z")

</div>

Sorry , I was wrong , it should be: [[-s /Users/scriptfans/.rvm/scripts/rvm]] && TERM=xterm-256color source /Users/scriptfans/.rvm/scripts/rvm
