Hi, I was wondering if someone could help me out. I'm still relatively
new to mac interface and have been trying to get back into ruby from a
windows perspective from a few years ago. I cannot seem to get my
computer to recognize simple gem commands such as 'require' within my
code. I use textwrangler and direct terminal lines but get results that
return things such as cannot find command 'require.rb'. I have also done
a search through all of my lists in my env's and it continues to change
with each version of ruby that I utilize. I am using the most recent
version of RVM and possibly have some other management software that may
be conflicting- I'm not sure. I think that I have honestly broken my
library but cannot figure out the exact problem- possibly could have
deleted my default ruby repository. Any help would be amazing as I am
about to scream at the top of my lungs after months of not being able to
test anything that I have re learned with the exception of reiterating
code back into an online interactive tutor. I would be so grateful.
Can you copy and paste the exact output of the following commands in your terminal?
$ uname -a
$ which ruby
$ which gem
$ rvm list
$ env|grep -i ruby
Also, show us a piece of code that doesn't work if possible. I want to make sure that there's not some error in your code that might have missed.
Best Regards,
···
On 4 Φεβ 2014, at 05:55 , Raf Ri <lists@ruby-forum.com> wrote:
Hi, I was wondering if someone could help me out. I'm still relatively
new to mac interface and have been trying to get back into ruby from a
windows perspective from a few years ago. I cannot seem to get my
computer to recognize simple gem commands such as 'require' within my
code. I use textwrangler and direct terminal lines but get results that
return things such as cannot find command 'require.rb'. I have also done
a search through all of my lists in my env's and it continues to change
with each version of ruby that I utilize. I am using the most recent
version of RVM and possibly have some other management software that may
be conflicting- I'm not sure. I think that I have honestly broken my
library but cannot figure out the exact problem- possibly could have
deleted my default ruby repository. Any help would be amazing as I am
about to scream at the top of my lungs after months of not being able to
test anything that I have re learned with the exception of reiterating
code back into an online interactive tutor. I would be so grateful.
email: atma@convalesco.org
URL: http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5
--
The wise man said: "Never argue with an idiot. They bring you down to their level and beat you with experience."
You should also clean up your system and write down exactly what you are
and were doing. It is not a good idea to just install RVM in the hope
that everything magically works afterwards.
After you cleaned up and removed all old files, install ruby anew but
make sure you follow the steps PROPERLY.
--------------------------------------------------------------------------
As far as a line of code, I won't even use one of my own. I'll call a
gem that I've been trying to test on my machine to show you. It should
be attached as a .rb file.
My error return in Aptana for running from the interface is as follows:
/Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require': cannot load such file -- rubygame (LoadError)
from
/Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from /Users/user/Documents/Aptana Studio 3
Workspace/PacAttack/PacAttack
Ruby\/gameprog1/gameprog1/01_main_loop.rb:3:in `<main>'
I'm absolutely certain that whatever this issue is will end up being
user error on my behalf- I just hope that you could help me figure it
out. Thanks a ton man.
Also @Panagiotis Atmatzidis, I cannot attach a .rb file to send so I'll
just copy and paste the test file.
#!/usr/bin/env ruby
require 'rubygems'
require 'rubygame'
include Rubygame
# The main loop method. This is called at the
# bottom of the file. This contains the infinite
# main loop, and is exited when a QuitEvent
# is received.
def main_loop
# Set up the objects the main loop will
# need.
# The screen is the window displayed on the
# screen.
screen = Screen.new [640, 480]
# The event queue handles events from the
# operating system
queue = EventQueue.new
# The clock limits the framerate to 30fps
clock = Clock.new
clock.target_framerate = 30
# This is the infinite main loop
loop do
# Pause the program for a short amount of
# time so it doesn't exceed 30fps
clock.tick
# Process all events, return if the window
# was closed
queue.each do|e|
return if e.is_a? QuitEvent
end
# Fill the screen with a grey color and
# display it on the monitor
screen.fill [200, 200, 200]
screen.update
end
ensure
Rubygame.quit
end
# If this file was the one executed from the
# command line, run the main loop.
if $0 == __FILE__
main_loop
end
You should also clean up your system and write down exactly what you are
and were doing. It is not a good idea to just install RVM in the hope
that everything magically works afterwards.
After you cleaned up and removed all old files, install ruby anew but
make sure you follow the steps PROPERLY.
How would you recommend that I "clean my system?"
Do you mean that I should run a standard OS clean up utility or
something more acute?
# => - current
# =* - current && default
# * - default
env>grep -i ruby
GEM_HOME=/Users/user/.rvm/gems/ruby-2.1.0
IRBRC=/Users/user/.rvm/rubies/ruby-2.1.0/.irbrc
MY_RUBY_HOME=/Users/user/.rvm/rubies/ruby-2.1.0
PATH=/Users/user/.rvm/gems/ruby-2.1.0/bin:/Users/user/.rvm/gems/ruby-2.1.0@global/bin:/Users/user/.rvm/rubies/ruby-2.1.0/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/usr/X11/bin:/Users/user/.rvm/bin
GEM_PATH=/Users/user/.rvm/gems/ruby-2.1.0:/Users/user/.rvm/gems/ruby-2.1.0@global
--------------------------------------------------------------------------
As far as a line of code, I won't even use one of my own. I'll call a
gem that I've been trying to test on my machine to show you. It should
be attached as a .rb file.
My error return in Aptana for running from the interface is as follows:
/Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require': cannot load such file -- rubygame (LoadError)
from
/Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from /Users/user/Documents/Aptana Studio 3
Workspace/PacAttack/PacAttack
Ruby\/gameprog1/gameprog1/01_main_loop.rb:3:in `<main>'
I'm absolutely certain that whatever this issue is will end up being
user error on my behalf- I just hope that you could help me figure it
out. Thanks a ton man.
One more thing, did you try to run the ruby code from terminal?
Please see if it finds the gem when running from terminal, so we could
isolate it as an aptana issue.
One more thing to do is to run this _inside_ a ruby script inside
Aptana. Just to see if Aptana is running the scripts in a different
enviroment than your terminal.
# => - current
# =* - current && default
# * - default
env>grep -i ruby
GEM_HOME=/Users/user/.rvm/gems/ruby-2.1.0
IRBRC=/Users/user/.rvm/rubies/ruby-2.1.0/.irbrc
MY_RUBY_HOME=/Users/user/.rvm/rubies/ruby-2.1.0
PATH=/Users/user/.rvm/gems/ruby-2.1.0/bin:/Users/user/.rvm/gems/ruby-2.1.0@global/bin:/Users/user/.rvm/rubies/ruby-2.1.0/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/usr/X11/bin:/Users/user/.rvm/bin
GEM_PATH=/Users/user/.rvm/gems/ruby-2.1.0:/Users/user/.rvm/gems/ruby-2.1.0@global
--------------------------------------------------------------------------
As far as a line of code, I won't even use one of my own. I'll call a
gem that I've been trying to test on my machine to show you. It should
be attached as a .rb file.
My error return in Aptana for running from the interface is as follows:
/Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require': cannot load such file -- rubygame (LoadError)
from
/Users/user/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from /Users/user/Documents/Aptana Studio 3
Workspace/PacAttack/PacAttack
Ruby\/gameprog1/gameprog1/01_main_loop.rb:3:in `<main>'
I'm absolutely certain that whatever this issue is will end up being
user error on my behalf- I just hope that you could help me figure it
out. Thanks a ton man.
One more thing to do is to run this _inside_ a ruby script inside
Aptana. Just to see if Aptana is running the scripts in a different
enviroment than your terminal.
Oh nice, very true. I figured that could be an issue but I didn't think
to check for it outside of the graphical interface. Thanks
(I mean, Aptana running the code in a different enviromment.)
Abinoam Jr.
···
On Sun, Feb 9, 2014 at 4:10 PM, Raf Ri <lists@ruby-forum.com> wrote:
One more thing to do is to run this _inside_ a ruby script inside
Aptana. Just to see if Aptana is running the scripts in a different
enviroment than your terminal.
Oh nice, very true. I figured that could be an issue but I didn't think
to check for it outside of the graphical interface. Thanks