Difference between revisions of "Ruby Setup"

From CSE425S Wiki
Jump to navigation Jump to search
(Created page with "==Language== ===Mac OSX=== ====Standard Ruby==== Nicely, Ruby ships with the Mac standard installation. While it may not be the most up to date version, it may be the best op...")
 
 
(56 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Language==
 
==Language==
 
===Mac OSX===
 
===Mac OSX===
 +
Note: depending on how the permissions are set up on your machine you may need to prefix a command with <code>sudo</code> or perhaps you may have to omit <code>sudo</code>.
 +
 +
====[https://brew.sh/ Homebrew]====
 +
<nowiki>/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" </nowiki>
 +
<!--
 
====Standard Ruby====
 
====Standard Ruby====
 
Nicely, Ruby ships with the Mac standard installation.  While it may not be the most up to date version, it may be the best option to simply use your default version: /usr/bin/ruby.
 
Nicely, Ruby ships with the Mac standard installation.  While it may not be the most up to date version, it may be the best option to simply use your default version: /usr/bin/ruby.
 +
-->
 +
====Install Ruby====
 +
<nowiki>brew install ruby</nowiki>
  
−
====Tk Gem====
+
====Add Ruby To Path====
−
Sadly, it will not be too surprising if this fails.  Reach out if you experience problems on this front.
+
if Mac OSX 10.15 Catalina or greater
  
−
<nowiki>sudo gem install tk</nowiki>
+
    ~/.zshrc
  
−
====OS Gem====
+
else
−
<nowiki>sudo gem install os</nowiki>
 
  
−
====PNG Gem====
+
    ~/.bash_profile
−
<nowiki>sudo gem install chunky_png</nowiki>
 
  
−
====[https://brew.sh/ Homebrew]====
+
Add this line:
−
<nowiki>/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" </nowiki>
 
  
−
====OpenGL Runtime====
+
  <nowiki>export PATH="/usr/local/opt/ruby/bin:$PATH"</nowiki>
−
  <nowiki>sudo brew install glfw</nowiki>
 
  
−
====OpenGL Gem====
+
====check ruby====
−
<nowiki>sudo gem install opengl-bindings</nowiki>
+
You can either
  
−
<!--
+
1) restart your terminal
−
=====Install ActiveTcl 8.5=====
 
−
[https://www.activestate.com/products/tcl/downloads/ Install ActiveTcl 8.5 (not 8.6) from www.activestate.com]
 
−
=====Install [https://rvm.io/rvm/install Ruby Version Manager]=====
 
−
<nowiki>\curl -sSL https://get.rvm.io | bash</nowiki>
 
−
=====Install Ruby With Tcl and Tk=====
 
−
<nowiki>rvm reinstall ruby-2.2.3 --with-tcl --with-tk</nowiki>
 
−
=====Set Ruby Version=====
 
−
<nowiki>rvm use 2.2.3 --default</nowiki>
 
−
=====Confirm Version=====
 
−
<nowiki>ruby --version</nowiki>
 
−
-->
 
  
−
===Windows===
+
or
−
====Ruby Installer====
 
−
[https://rubyinstaller.org/downloads/ Download From RubyInstaller]
 
  
−
[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)]
+
2) source the appropriate configuration file based on your shell (which is often dependent on the OSX version)
  
−
====Tk Gem====
+
  <nowiki>source .zshrc</nowiki>
−
  <nowiki>gem install tk</nowiki>
 
  
−
====OS Gem====
+
or
−
<nowiki>gem install os</nowiki>
 
  
−
====PNG Gem====
+
  <nowiki>source .bash_profile</nowiki>
−
  <nowiki>gem install chunky_png</nowiki>
 
  
−
====OpenGL Gem====
+
Then run
−
<nowiki>gem install opengl-bindings</nowiki>
 
  
−
====Zip Gem====
+
  <nowiki>ruby --version</nowiki>
−
  <nowiki>gem install zip</nowiki>
 
  
−
====OpenGL Runtime====
+
===Windows===
−
[https://www.transmissionzero.co.uk/files/software/development/GLUT/freeglut-MinGW.zip Download FreeGLUT]
+
====Ruby====
 +
<!--
 +
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)]
 +
-->
 +
Download and Install [https://rubyinstaller.org/downloads/ https://rubyinstaller.org/downloads/]
  
 
===Linux===
 
===Linux===
−
====ActiveTcl====
+
====Ruby Language====
−
Note: you will need to create an account to download ActiveTcl '''8.5'''.
 
  
−
Note: ActiveTcl 8.6 has be known to cause problems.
+
=====Fedora=====
 +
[https://developer.fedoraproject.org/tech/languages/ruby/ruby-installation.html install ruby]
  
−
[https://www.activestate.com/products/tcl/downloads/ Download and Install ActiveTcl '''8.5''']
+
=====Ubuntu=====
−
====Ruby Language With Tk====
+
<nowiki>sudo apt-get install ruby-full</nowiki>
−
A path that has worked on Ubuntu 20.04:
 
  
−
  <nowiki>sudo apt-get install ruby-full</nowiki>
+
==Gems==
 +
  gem install bundler
  
−
  <nowiki>sudo gem install tk -- --with-ActiveTcl</nowiki>
+
  bundler install
  
−
====OS Gem====
+
==IDE==
−
<nowiki>sudo gem install os</nowiki>
+
* [https://www.jetbrains.com/student/ Apply for student status with JetBrains]
 +
* [https://www.jetbrains.com/ruby/download/ Download and Install RubyMine]
 +
* Ensure that the Ruby SDK and Gems setting is correctly configured
  
−
====PNG Gem====
+
<!--
−
<nowiki>sudo gem install chunky_png</nowiki>
+
==Check Installation==
 +
-->
 +
<!--
 +
'''NOTE: CSE 425s no longer uses tk so there is no longer a tk_check.rb to run.'''
  
−
====OpenGL Runtime====
+
<youtube>7KN7NJ7VvNE</youtube>
−
<nowiki>sudo apt-get update</nowiki>
+
===Tk===
 +
{{RubyToRun|tk_check|installation_check|main}}
  
−
<nowiki>sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev</nowiki>
+
[[File:Tk installation check.png]]
 +
-->
 +
<!--
 +
===OpenGL===
  
−
<nowiki>sudo apt-get install libglfw3-dev</nowiki>
+
Mac users- run this:
  
−
====OpenGL Gem====
+
{{RubyToRun|mac_osx_glfw_downloader_and_extractor|installation_check|main}}
−
<nowiki>sudo gem install opengl-bindings</nowiki>
 
  
−
<!-- Does NOT seem to be required for Linux: gem install glfw3-->
+
Everyone, including Mac users, run this:
−
<!--
 
−
===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===
+
{{RubyToRun|opengl_check|installation_check|main}}
−
====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====
+
[[File:Opengl  installation check.png]]
  
−
==Gems==
+
===OpenGL Texture===
−
<nowiki>gem install os
+
{{RubyToRun|opengl_texture_check|installation_check|main}}
−
gem install opengl-bindings
 
−
gem install glfw3
 
−
gem install chunky_png
 
−
gem install launchy
 
−
gem install tk</nowiki>
 
−
-->
 
  
−
<!--
+
[[File:Opengl texture installation check.png]]
−
====Default Installation====
 
−
Run RubyMine
 
−
Open Settings
 
−
Languages & Frameworks
 
−
Ruby SDK and Gems
 
−
/usr/bin/ruby
 
 
-->
 
-->
−
 
−
==IDE==
 
−
* [https://www.jetbrains.com/student/ Apply for student status with JetBrains]
 
−
* [https://www.jetbrains.com/ruby/download/ Download and Install RubyMine]
 

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