Difference between revisions of "Ruby Setup"

From CSE425S Wiki
Jump to navigation Jump to search
 
(33 intermediate revisions by the same user not shown)
Line 43: Line 43:
  
 
  <nowiki>ruby --version</nowiki>
 
  <nowiki>ruby --version</nowiki>
−
 
−
which should report version <code>2.7.2</code> as of Fall 2020.
 
−
 
−
====Active Tcl 8.5====
 
−
Install [[Active_Tcl_Setup|Active Tcl 8.5]]
 
−
 
−
====Tk Gem====
 
−
<nowiki>sudo gem install tk</nowiki>
 
−
 
−
====OS Gem====
 
−
<nowiki>sudo gem install os</nowiki>
 
−
 
−
====PNG Gem====
 
−
<nowiki>sudo gem install chunky_png</nowiki>
 
−
 
−
====OpenGL Runtime====
 
−
<nowiki>brew install glfw</nowiki>
 
−
 
−
====OpenGL Gem====
 
−
<nowiki>sudo gem install opengl-bindings</nowiki>
 
−
 
−
====Opener Gem====
 
−
<nowiki>sudo gem install opener</nowiki>
 
  
 
===Windows===
 
===Windows===
−
====Ruby + Tk====
+
====Ruby====
−
We have two possible paths to installing Ruby + Tk, both involve downloading from [https://rubyinstaller.org/ RubyInstaller].
+
<!--
−
 
+
Download and Install [https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.2-1/rubyinstaller-devkit-3.1.2-1-x64.exe Ruby+Devkit 3.1.2-1 (x64)]
−
{| class="wikitable"
+
-->
−
!colspan="2"|Choose Path
+
Download and Install [https://rubyinstaller.org/downloads/ https://rubyinstaller.org/downloads/]
−
|-
 
−
|&darr; &darr; &darr; Path A (Latest Version 2.7.2) &darr; &darr; &darr;
 
−
|&darr; &darr; &darr; Path B (Legacy Version 2.3.3) &darr; &darr; &darr;
 
−
|-
 
−
|[https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.2-1/rubyinstaller-devkit-2.7.2-1-x64.exe Ruby+Devkit 2.7.2-1 (x64)]
 
−
|[https://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.3.3-x64.exe  Ruby 2.3.3 (x64)]
 
−
 
 
−
Note: Best sure to select Tk during installation.
 
−
|-
 
−
| <nowiki>gem install tk</nowiki>
 
−
|
 
−
|}
 
−
 
 
−
====OS Gem====
 
−
<nowiki>gem install os</nowiki>
 
−
 
 
−
====PNG Gem====
 
−
<nowiki>gem install chunky_png</nowiki>
 
−
 
 
−
====OpenGL Gem====
 
−
<nowiki>gem install opengl-bindings</nowiki>
 
−
 
 
−
====Zip Gem====
 
−
<nowiki>gem install zip</nowiki>
 
−
 
 
−
====OpenGL Runtime====
 
−
NOTE: the first time you run one of the course's Ruby script which uses OpenGL, it will automatically download and extract [https://www.transmissionzero.co.uk/files/software/development/GLUT/freeglut-MinGW.zip FreeGLUT] and [https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.bin.WIN64.zip GLFW3] to your ~/Downloads/CSE425s folder and use the files within.
 
−
 
 
−
====Opener Gem====
 
−
<nowiki>gem install opener</nowiki>
 
  
 
===Linux===
 
===Linux===
−
====ActiveTcl====
+
====Ruby Language====
−
{{:Active_Tcl_Setup}}
 
  
−
====Ruby Language With Tk====
+
=====Fedora=====
−
A path that has worked on Ubuntu 20.04:
+
[https://developer.fedoraproject.org/tech/languages/ruby/ruby-installation.html install ruby]
  
 +
=====Ubuntu=====
 
  <nowiki>sudo apt-get install ruby-full</nowiki>
 
  <nowiki>sudo apt-get install ruby-full</nowiki>
−
 
−
<nowiki>sudo gem install tk --with-ActiveTcl</nowiki>
 
−
 
−
====OS Gem====
 
−
<nowiki>sudo gem install os</nowiki>
 
−
 
−
====PNG Gem====
 
−
<nowiki>sudo gem install chunky_png</nowiki>
 
−
 
−
====OpenGL Runtime====
 
−
<nowiki>sudo apt-get update</nowiki>
 
−
 
−
<nowiki>sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev</nowiki>
 
−
 
−
<nowiki>sudo apt-get install libglfw3-dev</nowiki>
 
−
 
−
====OpenGL Gem====
 
−
<nowiki>sudo gem install opengl-bindings</nowiki>
 
−
 
−
====Opener Gem====
 
−
<nowiki>sudo gem install opener</nowiki>
 
−
 
−
<!-- Does NOT seem to be required for Linux: gem install glfw3-->
 
−
<!--
 
−
===Windows===
 
−
====Via Download====
 
−
[http://aspn.activestate.com/ASPN/Downloads/ActiveTcl/ ActiveTcl (Includes Tk) Community Edition]
 
−
====Via Chocolatey====
 
−
<nowiki>choco install glfw3</nowiki>
 
−
<nowiki>choco install activetcl</nowiki>
 
−
 
−
===Linux===
 
−
====Ubuntu====
 
−
<nowiki>sudo apt-get update
 
−
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
 
−
sudo apt-get install libglfw3-dev
 
−
sudo apt-get install libtcltk-ruby</nowiki>
 
−
 
−
====Fedora====
 
  
 
==Gems==
 
==Gems==
−
  <nowiki>gem install os
+
  gem install bundler
−
gem install opengl-bindings
 
−
gem install glfw3
 
−
gem install chunky_png
 
−
gem install launchy
 
−
gem install tk</nowiki>
 
−
-->
 
  
−
<!--
+
bundler install
−
====Default Installation====
 
−
Run RubyMine
 
−
Open Settings
 
−
Languages & Frameworks
 
−
Ruby SDK and Gems
 
−
/usr/bin/ruby
 
−
-->
 
  
 
==IDE==
 
==IDE==
Line 175: Line 70:
 
* Ensure that the Ruby SDK and Gems setting is correctly configured
 
* Ensure that the Ruby SDK and Gems setting is correctly configured
  
 +
<!--
 
==Check Installation==
 
==Check Installation==
 +
-->
 +
<!--
 +
'''NOTE: CSE 425s no longer uses tk so there is no longer a tk_check.rb to run.'''
 +
 +
<youtube>7KN7NJ7VvNE</youtube>
 
===Tk===
 
===Tk===
−
{{RubyToRun|tk_check|installation_check}}
+
{{RubyToRun|tk_check|installation_check|main}}
  
 
[[File:Tk installation check.png]]
 
[[File:Tk installation check.png]]
 +
-->
 +
<!--
 +
===OpenGL===
  
−
===OpenGL===
+
Mac users- run this:
−
{{RubyToRun|opengl_check|installation_check}}
+
 
 +
{{RubyToRun|mac_osx_glfw_downloader_and_extractor|installation_check|main}}
 +
 
 +
Everyone, including Mac users, run this:
 +
 
 +
{{RubyToRun|opengl_check|installation_check|main}}
  
 
[[File:Opengl  installation check.png]]
 
[[File:Opengl  installation check.png]]
  
 
===OpenGL Texture===
 
===OpenGL Texture===
−
{{RubyToRun|opengl_texture_check|installation_check}}
+
{{RubyToRun|opengl_texture_check|installation_check|main}}
  
 
[[File:Opengl texture installation check.png]]
 
[[File:Opengl texture installation check.png]]
 +
-->

Latest revision as of 19:58, 20 November 2025

Language

Mac OSX

Note: depending on how the permissions are set up on your machine you may need to prefix a command with sudo or perhaps you may have to omit sudo.

Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" 

Install Ruby

brew install ruby

Add Ruby To Path

if Mac OSX 10.15 Catalina or greater

   ~/.zshrc

else

   ~/.bash_profile

Add this line:

export PATH="/usr/local/opt/ruby/bin:$PATH"

check ruby

You can either

1) restart your terminal

or

2) source the appropriate configuration file based on your shell (which is often dependent on the OSX version)

source .zshrc

or

source .bash_profile

Then run

ruby --version

Windows

Ruby

Download and Install https://rubyinstaller.org/downloads/

Linux

Ruby Language

Fedora

install ruby

Ubuntu
sudo apt-get install ruby-full

Gems

gem install bundler
bundler install

IDE