<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>PiCrate gem</title>
    <description>The picrate gem is ruby implementation of processing, targetting raspberrypi and linux works on 32 bit raspbian Buster (and 64 bit Manajaro raspberryPI4).
</description>
    <link>https://ruby-processing.github.io/PiCrate/</link>
    <atom:link href="https://ruby-processing.github.io/PiCrate/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Thu, 20 Jan 2022 20:31:05 +0000</pubDate>
    <lastBuildDate>Thu, 20 Jan 2022 20:31:05 +0000</lastBuildDate>
    <generator>Jekyll v3.9.0</generator>
    
      <item>
        <title>Getting Started Manjaro</title>
        <description>&lt;p&gt;If Manjaro does not come with a pre-installed java, then the first step is to install a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jdk&lt;/code&gt; the distro version (jdk16) should work.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; jre-openjdk &lt;span class=&quot;c&quot;&gt;# current distro version jdk17&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;You can also use pacman to install jruby&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; jruby &lt;span class=&quot;c&quot;&gt;# current version jruby-9.3.0.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It is probably a good idea to create a local gem store (rather needing to use sudo to install gems)&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; vim &lt;span class=&quot;c&quot;&gt;# all you need if your happy with vim&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Vim is not installed by default&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; geany &lt;span class=&quot;c&quot;&gt;# if you prefer a GUI&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Geany is not installed by default&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; ~/.gem/ruby/2.6.0 &lt;span class=&quot;c&quot;&gt;# current MRI version supported by jruby&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now set your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GEM_HOME&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GEM_PATH&lt;/code&gt; and amend your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; as follows:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;export GEM_HOME=&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;{HOME}/.gem/ruby/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MRI_RUBY&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.bashrc
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;export GEM_PATH=&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;{HOME}/.gem/ruby/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MRI_RUBY&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.bashrc
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;export PATH=&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;{PATH}:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;{GEM_PATH}/bin&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.bashrc
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; ~/.bashrc &lt;span class=&quot;c&quot;&gt;# to update environment without re-logging in&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now should be ready to install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;picrate&lt;/code&gt; and other gems. But speed up install time you should set &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--no-document&lt;/code&gt; option in ~/.gemrc&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;touch&lt;/span&gt; ~/.gemrc
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;gem: --no-document&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; ~/.gemrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;To install latest picrate and its dependencies:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jgem &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;picrate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Geany is a good editor/ide for PiCrate on the RaspberryPI (install via pacman), but some may prefer vim. For geany you should edit/preferences/Terminal to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Execute programs in the VTE&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For a first install:-&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;picrate &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# no args, install samples and geany config&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# or&lt;/span&gt;
picrate &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; Samples &lt;span class=&quot;c&quot;&gt;# to omit geany config&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This installs example sketches in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/projects/examples&lt;/code&gt; and ties them into a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geany&lt;/code&gt; project &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;examples.geany&lt;/code&gt;. It should also be possible to run sketches from the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geany&lt;/code&gt; ide. The geany config creates &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;picrate.rb&lt;/code&gt; template sketch so you can create a new sketch with template.&lt;/p&gt;

&lt;p&gt;To create a template sketch from the command line:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;picrate &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; my_sketch 600 400
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;creates file my_sketch.rb&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/env jruby&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# frozen_string_literal: false&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'picrate'&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MySketch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Processing&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;App&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;settings&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setup&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sketch_title&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'My Sketch'&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;draw&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;MySketch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Edit in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim&lt;/code&gt; (at command line) or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geany&lt;/code&gt; (gui), you may need to install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vim my_sketch.rb
:!jruby % &lt;span class=&quot;c&quot;&gt;# from vim runs the sketch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To run sketches from command line:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jruby &lt;span class=&quot;nt&quot;&gt;--dev&lt;/span&gt; my_sketch.rb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or even &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod +x my_sketch.rb&lt;/code&gt; to make an executable script.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;https://ruby-processing.github.io/PiCrate/editors/geany&quot;&gt;editors&lt;/a&gt; geany, for how to run sketches from a gui.&lt;/p&gt;

&lt;h3 id=&quot;jwishy-sketch-running-on-raspberrypi&quot;&gt;JWishy Sketch Running on RaspberryPI&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://ruby-processing.github.io/PiCrate/assets/jwishy_buster.png&quot; alt=&quot;jwishy_buster&quot; /&gt;&lt;/p&gt;

</description>
        <pubDate>Mon, 11 May 2020 07:34:13 +0000</pubDate>
        <link>https://ruby-processing.github.io/PiCrate/getting_manjaro/</link>
        <guid isPermaLink="true">https://ruby-processing.github.io/PiCrate/getting_manjaro/</guid>
        
        
        <category>PiCrate</category>
        
        <category>update</category>
        
      </item>
    
      <item>
        <title>Automated PiCrate Install</title>
        <description>&lt;p&gt;For a semi-automated setup and install, download and extract &lt;a href=&quot;https://gist.github.com/monkstone/6ae9840d7b7008c177b4a9f589d14ec6&quot;&gt;this gist&lt;/a&gt;. To keep your system clean put the file in a folder say
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/install_picrate&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/picrate_install
bash picrate2_install.sh &lt;span class=&quot;c&quot;&gt;# to run default task&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h4 id=&quot;what-the-script-does&quot;&gt;What the script does&lt;/h4&gt;
&lt;ol&gt;
  &lt;li&gt;Downloads JRuby&lt;/li&gt;
  &lt;li&gt;Installs JRuby to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/opt&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Uses &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;update-alternatives&lt;/code&gt; to configure &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jruby&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jgem&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jirb&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;The script checks for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GEM_HOME&lt;/code&gt;, if undefined it modifies &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.profile&lt;/code&gt; to define &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GEM_HOME&lt;/code&gt; and puts gem binaries on your path, at logon.&lt;/li&gt;
  &lt;li&gt;Installs jdk11 if required sets &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JAVA_HOME&lt;/code&gt;, needed to support jruby&lt;/li&gt;
  &lt;li&gt;Creates &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.gemrc&lt;/code&gt; with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gem: no-document&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Installs &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;picrate&lt;/code&gt; gem
To install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;picrate_samples&lt;/code&gt; also configures &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geanyIDE&lt;/code&gt; for use with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;picrate&lt;/code&gt; run
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;picrate --install&lt;/code&gt; in a bash console&lt;/li&gt;
&lt;/ol&gt;

&lt;h4 id=&quot;note&quot;&gt;Note&lt;/h4&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GEM_HOME&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JAVA_HOME&lt;/code&gt; and path to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gem&lt;/code&gt; binaries are not available until next logon, to use immediately you could:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; ~/.profile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;NB: this only works in current shell, so if you want to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geanyIDE&lt;/code&gt; you should logout and logon again.&lt;/p&gt;
</description>
        <pubDate>Mon, 09 Mar 2020 07:34:13 +0000</pubDate>
        <link>https://ruby-processing.github.io/PiCrate/install_picrate/</link>
        <guid isPermaLink="true">https://ruby-processing.github.io/PiCrate/install_picrate/</guid>
        
        
        <category>PiCrate</category>
        
        <category>update</category>
        
      </item>
    
      <item>
        <title>Getting Started Buster</title>
        <description>&lt;p&gt;Raspbian Buster installs OpenJDK11 (hard float) and that is just fine, if you have more that one version of java installed you could use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;update-alternatives&lt;/code&gt; tool to manage their use. NB: Will not work with OpenJDK-8.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then install JRuby see&lt;/strong&gt; &lt;a href=&quot;https://ruby-processing.github.io/PiCrate/install_jruby/&quot;&gt;jruby&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jgem &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;picrate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;For a first install:-&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;picrate &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# no args, install samples and geany config&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# or&lt;/span&gt;
picrate &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; Samples &lt;span class=&quot;c&quot;&gt;# to omit geany config&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This installs example sketches in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/sample_sketches&lt;/code&gt; and ties them into a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geany&lt;/code&gt; project &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;picrate.geany&lt;/code&gt;. It should also be possible to run sketches from the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geany&lt;/code&gt; ide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install processing libraries&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;picrate &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; Sound
picrate &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; video &lt;span class=&quot;c&quot;&gt;# install beta verion of vanilla video for now&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To create a template sketch from the command line:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;picrate &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; my_sketch 600 400
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;creates file my_sketch.rb&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/env jruby&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# frozen_string_literal: false&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'picrate'&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MySketch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Processing&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;App&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;settings&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setup&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sketch_title&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'My Sketch'&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;draw&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;MySketch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Edit in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim&lt;/code&gt; (at command line) or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geany&lt;/code&gt; (gui), you may need to install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vim my_sketch.rb
:!jruby % &lt;span class=&quot;c&quot;&gt;# from vim runs the sketch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To run sketches from command line:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jruby my_sketch.rb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or even &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod +x my_sketch.rb&lt;/code&gt; to make an executable script.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;https://ruby-processing.github.io/PiCrate/editors/geany&quot;&gt;editors&lt;/a&gt; geany, for how to run sketches from a gui.&lt;/p&gt;

&lt;h3 id=&quot;circle-collision-sketch-running-on-raspberrypi&quot;&gt;Circle Collision Sketch Running on RaspberryPI&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://ruby-processing.github.io/PiCrate/assets/circle_collisions.png&quot; alt=&quot;circle_collisions&quot; /&gt;&lt;/p&gt;

</description>
        <pubDate>Mon, 09 Mar 2020 07:34:13 +0000</pubDate>
        <link>https://ruby-processing.github.io/PiCrate/getting/</link>
        <guid isPermaLink="true">https://ruby-processing.github.io/PiCrate/getting/</guid>
        
        
        <category>PiCrate</category>
        
        <category>update</category>
        
      </item>
    
      <item>
        <title>Getting Started RaspbianOS</title>
        <description>&lt;p&gt;RaspberryPI OS usually comes with a pre-installed jdk11. Before installing JRuby it might be worth setting the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JAVA_HOME&lt;/code&gt; environmental variable (&lt;em&gt;to supress reflection warnings&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Otherwise follow these instructions in order as needed:-&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update &lt;span class=&quot;c&quot;&gt;# sync your local database with current release&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update &lt;span class=&quot;c&quot;&gt;# update to latest release&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;openjdk-11-jdk &lt;span class=&quot;c&quot;&gt;# installs latest jdk11&lt;/span&gt;
java &lt;span class=&quot;nt&quot;&gt;-version&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# check installed version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;If you have already installed a version java the java version may not match you can control the &lt;em&gt;active&lt;/em&gt; java version on Debian using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;update-alternatives&lt;/code&gt; as follows:-&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-alternatives &lt;span class=&quot;nt&quot;&gt;--config&lt;/span&gt; java
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-alternatives &lt;span class=&quot;nt&quot;&gt;--config&lt;/span&gt; javac
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-alternatives &lt;span class=&quot;nt&quot;&gt;--config&lt;/span&gt; jar
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;See &lt;a href=&quot;http://ruby-processing.github.io/java/raspberry/&quot;&gt;java&lt;/a&gt; install for more explanations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then install JRuby see&lt;/strong&gt; &lt;a href=&quot;https://ruby-processing.github.io/PiCrate/install_jruby/&quot;&gt;jruby&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We strongly recommend that you create a local storage for gems on your system, as follows:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; ~/.gem/jruby/2.5.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now set your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GEM_HOME&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GEM_PATH&lt;/code&gt; and amend your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; as follows:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;export GEM_HOME=&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;{HOME}/.gem/ruby/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MRI_RUBY&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.profile
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;export GEM_PATH=&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;{HOME}/.gem/ruby/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MRI_RUBY&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.profile
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;export PATH=&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;{PATH}:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;{GEM_PATH}/bin&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.profile
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; ~/.profile &lt;span class=&quot;c&quot;&gt;# to update environment without re-logging in&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now should be ready to install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;picrate&lt;/code&gt; and other gems.
Install a local version of rake:-&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jgem &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;rake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;To install latest picrate and its dependencies:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jgem &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;picrate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;For a first install:-&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;picrate &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# no args, install samples and geany config&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# or&lt;/span&gt;
picrate &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; Samples &lt;span class=&quot;c&quot;&gt;# to omit geany config&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This installs example sketches in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/projects/examples&lt;/code&gt; and ties them into a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geany&lt;/code&gt; project &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;examples.geany&lt;/code&gt;. It should also be possible to run sketches from the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geany&lt;/code&gt; ide.&lt;/p&gt;

&lt;p&gt;To create a template sketch from the command line:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;picrate &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; my_sketch 600 400
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;creates file my_sketch.rb&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/env jruby&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# frozen_string_literal: false&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'picrate'&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MySketch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Processing&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;App&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;settings&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setup&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sketch_title&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'My Sketch'&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;draw&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;MySketch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Edit in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim&lt;/code&gt; (at command line) or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geany&lt;/code&gt; (gui), you may need to install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vim my_sketch.rb
:!jruby % &lt;span class=&quot;c&quot;&gt;# from vim runs the sketch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To run sketches from command line:-&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jruby my_sketch.rb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or even &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod +x my_sketch.rb&lt;/code&gt; to make an executable script.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;https://ruby-processing.github.io/PiCrate/editors/geany&quot;&gt;editors&lt;/a&gt; geany, for how to run sketches from a gui.&lt;/p&gt;

&lt;h3 id=&quot;jwishy-sketch-running-on-raspberrypi&quot;&gt;JWishy Sketch Running on RaspberryPI&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://ruby-processing.github.io/PiCrate/assets/jwishy_buster.png&quot; alt=&quot;jwishy_buster&quot; /&gt;&lt;/p&gt;

</description>
        <pubDate>Mon, 11 Nov 2019 07:34:13 +0000</pubDate>
        <link>https://ruby-processing.github.io/PiCrate/getting_buster/</link>
        <guid isPermaLink="true">https://ruby-processing.github.io/PiCrate/getting_buster/</guid>
        
        
        <category>PiCrate</category>
        
        <category>update</category>
        
      </item>
    
      <item>
        <title>Getting Started with Geany</title>
        <description>&lt;p&gt;The current version of raspbian installs jdk-11 (hard float) and that is just fine, if you have more that one version of java installed you could use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;update-alternatives&lt;/code&gt; tool to manage their use.&lt;/p&gt;

&lt;p&gt;Then install JRuby see &lt;a href=&quot;https://ruby-processing.github.io/PiCrate/install_jruby/&quot;&gt;jruby&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jgem &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;picrate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Install samples, and configure &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;geany&lt;/code&gt; ide (for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PiCrate&lt;/code&gt;)&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;picrate &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# or&lt;/span&gt;
picrate &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;or for no geany configuration&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;picrate &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; Samples
&lt;span class=&quot;c&quot;&gt;# or&lt;/span&gt;
picrate &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt; Samples
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Install processing libraries&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# picrate -i Sound not currently working&lt;/span&gt;
picrate &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; video &lt;span class=&quot;c&quot;&gt;# preferred over vanilla video for now&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;creating-sketches-from-the-geanyide&quot;&gt;Creating Sketches from the GeanyIDE&lt;/h3&gt;

&lt;p&gt;See &lt;a href=&quot;https://ruby-processing.github.io/PiCrate/editors/geany&quot;&gt;editors&lt;/a&gt; geany, for how to run sketches from a gui.&lt;/p&gt;

&lt;h3 id=&quot;running-picrate-sketch-on-raspberrypi-from-geany-editor&quot;&gt;Running PiCrate sketch on RaspberryPI from geany editor&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://ruby-processing.github.io/PiCrate/assets/geany.png&quot; alt=&quot;snake_kolam&quot; /&gt;&lt;/p&gt;

</description>
        <pubDate>Tue, 27 Nov 2018 07:34:13 +0000</pubDate>
        <link>https://ruby-processing.github.io/PiCrate/geany_ide/</link>
        <guid isPermaLink="true">https://ruby-processing.github.io/PiCrate/geany_ide/</guid>
        
        
        <category>PiCrate</category>
        
        <category>update</category>
        
      </item>
    
      <item>
        <title>Building PiCrate gem on Linux</title>
        <description>&lt;p&gt;Requirements:-&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Latest jogl-2.4.0-rc jars (place in ~/jogl-2.4-rc2021011 folder see &lt;a href=&quot;https://jogamp.org/deployment/archive/rc/v2.4.0-rc-20210111/jar/&quot;&gt;jogl-jars&lt;/a&gt;).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;jdk-11+ and maven&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Simply clone this distribution, then rake to build and test gem&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone &lt;span class=&quot;nt&quot;&gt;--depth&lt;/span&gt; 1 https://github.com/ruby-processing/PiCrate.git
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;PiCrate
rake &lt;span class=&quot;c&quot;&gt;# to build gem&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
        <pubDate>Sun, 18 Nov 2018 07:34:13 +0000</pubDate>
        <link>https://ruby-processing.github.io/PiCrate/picrate/update/2018/11/18/building-gem.html</link>
        <guid isPermaLink="true">https://ruby-processing.github.io/PiCrate/picrate/update/2018/11/18/building-gem.html</guid>
        
        
        <category>PiCrate</category>
        
        <category>update</category>
        
      </item>
    
      <item>
        <title>Installing JRuby on Archlinux arm</title>
        <description>&lt;p&gt;Might work, please let us know!!! Manjaro works OK.&lt;/p&gt;
</description>
        <pubDate>Thu, 24 May 2018 07:34:13 +0000</pubDate>
        <link>https://ruby-processing.github.io/PiCrate/picrate/update/2018/05/24/arch-linux-arm.html</link>
        <guid isPermaLink="true">https://ruby-processing.github.io/PiCrate/picrate/update/2018/05/24/arch-linux-arm.html</guid>
        
        
        <category>PiCrate</category>
        
        <category>update</category>
        
      </item>
    
      <item>
        <title>Processing API</title>
        <description>&lt;style&gt;
table{
    border-collapse: collapse;
    border-spacing: 0;
    border:2px solid #0000FF;
}

th{
    border:2px solid #0000FF;
}
&lt;/style&gt;

&lt;p&gt;You can use most &lt;a href=&quot;https://processing.org/reference/&quot;&gt;processing methods&lt;/a&gt; in picrate, but where possible you should prefer these ruby alternatives (you should also prefer Vec2D and Vec3D to PVector).
Here is a list of ruby alternatives to some ‘processing’ convenience methods; which with the exception of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;color&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;map1d&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;p5map&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;degrees&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;radians&lt;/code&gt; are just regular ruby methods.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;function&lt;/th&gt;
      &lt;th&gt;processing&lt;/th&gt;
      &lt;th&gt;picrate&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;camera&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;camera(args)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kamera(hash_args)&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;color string&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;color(#cc6600)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;color('#cc6600')&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;date/time&lt;/td&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;t = Time.now&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;day&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;t.day&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hour&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;t.hour&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;minute&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;t.minute&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;second&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;t.second&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;year&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;t.year&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;custom math&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;map(x, b0, eo, b1, e1)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;map1d(x, (b0..e0), (b1..e1))&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;map(x, b0, eo, b1, e1)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;p5map(x, b0, e0, b1, e1)&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;max(array)            &lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;array.max&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;min(array)            &lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;array.min&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;conversion&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;degrees(theta)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;theta.degrees&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;conversion&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;radians(theta)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;theta.radians&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;conversion&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hex(string)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;string.hex&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;conversion&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;unhex(string)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;string.to_i(base=16)&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;conversion&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;binary(c)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;c.to_s(2)&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;conversion&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;unbinary(string)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;string.to_i(base=2)&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;math&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;abs(x)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;x.abs&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;math&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;round(x)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;x.round&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;math&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ceil(x)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;x.ceil&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;math&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;random(x)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rand(x)&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;math&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;random(a, b)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rand(a..b)&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;math power&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pow(a, b)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;a**b&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;square&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sq(x)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;x * x&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;print&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;println(x)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;puts x&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;format&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;trim(string)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;string.strip&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;format&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nf(float_value, 0, 2)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;format('%.2f', float_value)&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;format&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nf(num, digit)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;num.to_s.rjust(digit, '0')&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;format&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nf(nf(num, left, right)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;see below&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;num.to_s.rjust(left, '0').ljust(left + right, '0')&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For examples of using time in sketches see &lt;a href=&quot;https://monkstone.github.io/time&quot;&gt;learning JRubyArt blog&lt;/a&gt;, &lt;a href=&quot;https://monkstone.github.io/timestamp/&quot;&gt;timestamp&lt;/a&gt; and this &lt;a href=&quot;https://github.com/ruby-processing/picrate-examples/blob/master//library/fastmath/clock.rb&quot;&gt;clock sketch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For example of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kamera&lt;/code&gt; usage see &lt;a href=&quot;https://github.com/ruby-processing/picrate-examples/blob/master//basics/camera/kmove_eye.rb&quot;&gt;kamera&lt;/a&gt;. To use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;selectInput&lt;/code&gt; see link to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;File Chooser&lt;/code&gt; in page header. We actually use the ruby Enumerable methods &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;max&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;min&lt;/code&gt; methods to make &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;max(*array)&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;min(*methods)&lt;/code&gt; available in picrate, so you could use the processing form providing you splat the array, but it is simpler to use the ruby method directly further you have the option with ruby of changing the [comparator via a block][comparator].&lt;/p&gt;

&lt;p&gt;NB: if you have any trouble with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;save&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;save_frame&lt;/code&gt; then use the option of providing an absolute path.  You can easily do this using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;data_path&lt;/code&gt; wrapper that does it for you see &lt;a href=&quot;https://ruby-processing.github.io/PiCrate/data_path/&quot;&gt;data_path method&lt;/a&gt;.&lt;/p&gt;

</description>
        <pubDate>Thu, 24 May 2018 07:34:13 +0000</pubDate>
        <link>https://ruby-processing.github.io/PiCrate/methods/alternative_methods/</link>
        <guid isPermaLink="true">https://ruby-processing.github.io/PiCrate/methods/alternative_methods/</guid>
        
        
        <category>PiCrate</category>
        
        <category>update</category>
        
      </item>
    
      <item>
        <title>Installing JRuby</title>
        <description>&lt;h3 id=&quot;manual-install&quot;&gt;Manual install&lt;/h3&gt;

&lt;p&gt;Pure jruby installation on raspbian no need for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rbenv&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rvm&lt;/code&gt; or existing ruby.&lt;/p&gt;

&lt;p&gt;Get the latest version from &lt;a href=&quot;&amp;quot;https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.3.2.0/jruby-dist-9.3.2.0-bin.tar.gz&amp;quot;&quot;&gt;http://jruby.org/download&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /opt
&lt;span class=&quot;nb&quot;&gt;sudo tar &lt;/span&gt;xzvf /pathToDownload/jruby-bin-9.3.2.0.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then use the excellent &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;update-alternatives&lt;/code&gt; tool to provide symbolic links to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jruby&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jgem&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jirb&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rake&lt;/code&gt; especially if you haven’t installed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mri&lt;/code&gt; ruby.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-alternatives &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt; /usr/bin/jruby jruby /opt/jruby&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;version&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;/bin/jruby 100
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-alternatives &lt;span class=&quot;nt&quot;&gt;--config&lt;/span&gt; jruby
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;gem_home&quot;&gt;GEM_HOME&lt;/h3&gt;

&lt;p&gt;You should prefer to install gems locally (no need for sudo). To do that it is convenient on linux to edit your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.profile&lt;/code&gt; (or equivalent eg &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~./bashrc&lt;/code&gt;) file as follows, the important thing is ensure that the gem bin directory is on your path.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;jpry&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;jruby -e &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;require 'pry'; binding.pry&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# export JAVA_HOME=&quot;/opt/jdk1.8.0_151&quot; # if using oracle java openjdk-8 is fine though&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GEM_HOME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/.gem/ruby/2.6.0&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GEM_PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/tux/.gem/ruby/2.6.0&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GEM_PATH&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/bin&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;automated-install-using-bash&quot;&gt;Automated install using bash&lt;/h3&gt;

&lt;p&gt;The &lt;a href=&quot;https://gist.github.com/monkstone/6ae9840d7b7008c177b4a9f589d14ec6&quot;&gt;picrate2_install.sh&lt;/a&gt; script currently installs jruby-9.3.0.0 and picrate-2.5.0.&lt;/p&gt;

&lt;p&gt;If you know better please post on wiki&lt;/p&gt;

</description>
        <pubDate>Thu, 24 May 2018 07:34:13 +0000</pubDate>
        <link>https://ruby-processing.github.io/PiCrate/install_jruby/</link>
        <guid isPermaLink="true">https://ruby-processing.github.io/PiCrate/install_jruby/</guid>
        
        
        <category>PiCrate</category>
        
        <category>update</category>
        
      </item>
    
  </channel>
</rss>
