Ruby in Aptana: Cannot Start Debugger - ruby

When I try to start debugging in Aptana Studio 3, an error occurs:
/Users/shia/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:296:in `to_specs': Could not find 'ruby-debug-ide' (>= 0) among 7 total gem(s) (Gem::LoadError)
from /Users/shia/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:307:in `to_spec'
from /Users/shia/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /Users/shia/.rvm/rubies/ruby-1.8.7-p374/bin/rdebug-ide:22
After a while a dialog pops out saying "An internal error occurred during: "Launching Game.rb". Could not connect to debugger on port 54008". (Game.rb is the file that I'm debugging.)
I'm using Ruby on OS X 10.9.1. I first installed the latest version, Ruby 2.0.0, using Homebrew. Then I found out the debugger doesn't work well with Ruby 1.9+, so I installed RVM and used it to install Ruby 1.8.7. Then I executed $rvm use 1.8.7 in the Terminal.
After that, I executed $gem install ruby-debug-ide and $gem install ruby-debug-base and everything looked OK. But when I restarted Aptana, the debugging still didn't work and returned the error above.
Not sure which step I'm missing here. Thank you very much.

I have the same problem, set the defualt ruby and gem set version for rvm.
rvm --default use 'ruby-2.1.1#global'
rvm --default use 'ruby-2.1.1'

Related

Chef kitchen ruby gems error fails to converge on windows

chef verify shows error that gems dependencies on this path error
C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb:310:in `to_specs': Could not find 'test-kitchen' (= 1.15.0) - did find: [test-kitchen-1.17.0] (Gem::MissingSpecVersionError)
GEM_PATH=C:/Users/ravikiran/AppData/Local/chefdk/gem/ruby/2.3.0;C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0', execute `gem env` for more information
from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb:320:in `to_spec'
from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
from C:/opscode/chefdk/bin/kitchen:19:in `<main>'
Remove your ~/.chefdk folder, you probably tried to upgrade some gems in-place at some point. Wiping that out should get you back to baseline (if it doesn't, reinstall the ChefDK package too).
how about installing the test-kitchen (= 1.15.0) gem, that it says is missing. See this on how to install a ruby gem. http://guides.rubygems.org/rubygems-basics/
update on how to install gem using the chefdk's ruby: I don't have a chefdk installed in a windows OS, but you should see the ruby installed by the chefdk here PATH_TO_chefdk/embedded/bin/ruby.
So, i just installed a chefdk on my win10 x64 (as its a friday :) )... And then to use the ruby from chefdk. follow this https://docs.chef.io/install_dk.html .. Refer to the "Powershell" section. But in short, just run chef shell-init powershell | Invoke-Expression in the PS console.
now you should be able to install the gem version.

rubygems.rb cannot be loaded

On Linux Mint 17.3, I upgraded from Ruby 1.9.2 to Ruby 2.3.0 using RVM, and now the 'gem' CLI and every Ruby program that uses gems are returning the following error:
<internal:gem_prelude>:1:in require': cannot load such file -- rubygems.rb (LoadError)
from <internal:gem_prelude>:1:in'`
I have tried reinstalling Ruby, switching to other versions (including back to 1.9.2), reinstalling RVM, and rvm fix-permissions, none of which have changed the error.
Any idea what's going on here?
EDIT: I was able to get CLI functionality back seemingly by repeatedly reinstalling 2.3.0 (rvm reinstall rather than uninstalling and reinstalling manually). However, programs that require gems are still breaking with the same error.
The below might help:
gem install rubygems-update
update_rubygems
If nothing helps, try to manually remove 1) all rubies from RVM and 2) rvm directory:
rm -rf /home/[username]/.rvm
and reinstall RVM from the scratch.

Failing to Debug Vagrant source code with RubyMine 2016.1

I am new to Ruby and Gems, Bundler, RVM, etc. although I have been a programmer for many years, including the past 5+ on PHP with PhpStorm.
I want to write a Vagrant Plugin so I wanted to set up debugging with RubyMine 2016.1 for Vagrant without modifying the source code However after hours and hours of trial and error I feel like I am just running around in circles.
I installed RVM and ran rvm install 2.3.0 then rvm use 2.3.0 and then tried to install this gem:
gem install ruby-debug-base19x --pre
And it would fail with these and several other errors:
ERROR: Error installing ruby-debug-base19x:
ERROR: Failed to build gem native extension.
current directory: /Users/mikeschinkel/.rvm/gems/ruby-2.3.0/gems/ruby-debug-base19x-0.11.31/ext/ruby_debug
/Users/mikeschinkel/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160513-39119-13cpfzr.rb extconf.rb
Ignoring debase-0.2.2.beta7 because its extensions are not built. Try: gem pristine debase --version 0.2.2.beta7
So I installed RVM and ran rvm install 1.9.3 then rvm use 1.9.3 and then the following ran without error:
gem install ruby-debug-base19x --pre
gem install ruby-debug-ide --pre
Then I go to Debug and I see this pop-up:
If I select yes there is a status dialog that appears to be trying to install these:
.../ruby-debug-base19x-0.11.31.gem
.../ruby-debug-ide-0.6.1-beta2.gem
After which RubyMine displays this error:
Error running Vagrant Up:
Cannot start debugger. Gem 'ruby-debug-ide' isn't installed or its executable script 'rdebug-ide' doesn't exist
If I try to debug again it just runs me through the same popup-install-then-error loop.
BTW, here is my Run/Debug Configuration:
P.S. The Vagrant .gemspec specifies >= 2.0.0 Ruby so I am worried that even if I can get it fixed RubyMine debugging won't work with, but hopefully not:
s.required_ruby_version = ">= 2.0.0"
Thanks in advance for any help.
-Mike

Unable to uninstall Ruby 2.0.0

i'm using rvm, i installed ruby 2.0 with rvm but i need to uninstall it to get ruby 1.9.3. But my terminal is doing strange things:
MacBook-Pro-Kuba:~ Kuba$ gem install bundler
Successfully installed bundler-1.3.5
Parsing documentation for bundler-1.3.5
1 gem installed
MacBook-Pro-Kuba:~ Kuba$ sudo rvm all do uninstall ruby
Preparing Uninstall...
Uninstall Began...
Uninstall Failed...
Reason: ErrorMissingBundle
So as you can see i'm definitely having bundler installed, and it's throwing this error. What should i do?
(i use mountain lion)
Why do you need to uninstall ruby2.0 to get ruby1.9.3? The whole idea of rvm is that you can have (and switch between) many different versions.
List the Rubies with rvm list.
Install (if required) with rvm install 1.9.3.
Swap to it with rvm use 1.9.3.

Can't install RubyZip gem on OS X Lion with RVM

TL;DR:
$ gem install rubyzip
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /Users/darth/.rvm/gems/ruby-1.9.2-p136/gems/rubyzip-0.9.4/README
And now in detail. I'm not sure which information is relevant, so I'm just gonna say it all.
I recently upgraded from OS X Snow Leopard to Lion (also upgraded Xcode to 4.2)
Everything worked just fine for a while
Today I decided to install some gems (RSpec, Cucumber), and I started getting date format warnings whenever I did anything with RubyGems
I decided to update RubyGems, from 1.3.6 (I'm not sure here) to current 1.8.11
The warning kept on popping up, so I tried to remove the gemset with rvm gemset empty, which also failed, because of some permission denied error (yes stupid me didn't write it down)
In result of that, I reinstalled Ruby via rvm remove 1.9.2 and rvm install 1.9.2 (I didn't forget to rvm use 1.9.2 --default after that.
I installed bundler gem install bundle and then tried to bundle install in my Rails 3.1.1 project, but it ends with error
Installing rubyzip (0.9.4)
Errno::EPERM: Operation not permitted - /Users/darth/.rvm/gems/ruby-1.9.2-p136/gems/rubyzip-0.9.4/README
An error occured while installing rubyzip (0.9.4), and Bundler cannot continue.
Make sure that `gem install rubyzip -v '0.9.4'` succeeds before bundling.
gem install rubyzip -v '0.9.4' gives the above mentioned error
The README file says to download source and install from there via ruby install.rb, which also ends in error
$ ruby install.rb
/Users/darth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/fileutils.rb:841:in `install': wrong number of arguments (4 for 3) (ArgumentError)
from install.rb:21:in `block in <main>'
from install.rb:18:in `each'
from install.rb:18:in `<main>'
Even executing tests fro rubyzip ends up in bunch of errors
$ rake test
rake/gempackagetask is deprecated. Use rubygems/package_task instead
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
/Users/darth/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -C test alltests.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- stdrubyexttest (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from alltests.rb:5:in `<main>'
rake aborted!
Command failed with status (1): [/Users/darth/.rvm/rubies/ruby-1.9.2-p136/b...]
Tasks: TOP => test
(See full trace by running task with --trace)
I'm out of ideas, what can I do?
I'm really not sure what caused this, but I managed to fix it by doing the following.
Since reinstalling Ruby 1.9.2 didn't help, I decided to be even more drastical and went down to rvm. I found out that I had version 1.1.something installed, which is about 9 months old.
I tried to update, but it didn't help, so rvm implode did the trick. I even had to sudo rm -rf ~/.rvm, probably because I managed to mess up some gem installs by adding sudo to them.
After reinstalling rvm and reinstalling 1.9.2, it seems like everything is working fine now, even with Xcode 4.2.
Lesson learned, rm -rf & reinstall is better than trying to upgrade from a year old version :)

Resources