problems with jruby version of ruby-debug - ruby

This problem no longer exists. ruby-debug works fine in jruby these days
Whenever I use 'n' to step over a line it steps into it instead. This happens to me on all the versions of jruby i've tried, the latest being 1.3.1
Does it work right for anyone? If so any idea how to fix it, because it's too painful when it steps into every function every time.
Also, I use it like this if it makes any difference.
require 'ruby-debug'; debugger

I've noticed this too. Have you tried using "step" instead, "step" seems to work for me.

currently doesn't work with 1.4.0 either, but ruby-debug does work with a trunk build of jruby

Related

Ruby : What changes needed to make test-unit-1.2.3 working with Ruby-2.4.1

I am new to Ruby Development. Now i am working on ruby test-framework code which was working fine with Ruby-1.8.7
Now i want to upgrade ruby for this framework. I have found that test-unit-1.2.3 is included in Ruby-1.8.7 so i have installed it separately with Ruby-2.4.1.
Currently i am facing method missing issue ["register_autorunner"] with this combination. Because these method have not been used in ruby-1.8.7
Can anyone please tell me other changes needed to make this combination [Ruby-2.4.1 , test-unit-1.2.3] working.
Thanks in advance
You should update to TestUnit 3.x, which will have a higher chance of working with Ruby 2.x. Then you need to figure out the changes between Ruby 1.8.7 and Ruby 2.4.1, and how to fix your existing code, which is most likely broken, even after you have fixed/updated your unit test configuration.
Also, consider a switch to Minitest or Rspec, as they are a lot more popular today, so it will be easier to find examples and supporting tools for them. Minitest is also the default test framework used by Ruby on Rails currently.
References:
https://www.jetbrains.com/research/devecosystem-2017/ruby/
http://guides.rubyonrails.org/v5.1/testing.html

Can Jekyll run on MagLev?

MagLev tries to be compatible with ruby 1.8.7
So it seems to me that Jekyll should be able to run on it...
And based on this previous question, seems that even some rails applications can run on it...
But has anyone actually tried it?
What were the problems you had?
If you haven't tried it, do you anticipate any major problems?
TIA
I just tried Jekyll on Maglev's 1.9 branch, and it doesn't work. Maglev falls down when using anything with C extensions; in this case, it's Jekyll's dependency on posix-spawn.
You might wanna check out the docs regarding the state of C extensions on Maglev.
AFAIK, Jekyll doesn't really have persistence (besides static files), so I'm not sure what you'd gain from using Maglev. You can definitely have a lot of fun with Maglev and Sinatra, give them a shot.

Ruby: code "updgrading" from 1.8.6 to 1.9.2

i'm interested in updating code which is written in ruby v1.8.6 to 1.9.2. Are there any useful links to read about (probably with some warnings and recommendations)?
Just to be clear, so, i'm not expecting any problems right now, but i would like to avoid them.
P.S.
Links like this one are mostly not helpful.
A slideshow showing the differences: http://slideshow.rubyforge.org/ruby19.html#11
I migrated an app from ruby 1.8.7 to 1.9.3 a few days ago, and no problems happened.
Bu i advise you to test all of your code for little bugs.
Verify that all the gems you depend on are 1.9.2 compatible. isitruby19.com is a good resource to check this.
Other than that, the best strategy is to try migrating and do some testing. If your application has comprehensive unit test coverage, this shouldn't be too painful.

Ruby problem(bug)- in rake gem

i am running ruby 1.9.2p0 on rails on windows OS with rubymine 3.1.1.
i use it for גseveral weeks.
a few days ago- i tried to run my project from rubymine and the console notification was:
"Could not find rake-0.8.7 in any of the sources
Process finished with exit code 7"
i googled it and i found reference to this problem in several places. the solution repeated most often was to delete the non-versioned "rake.gemspec" file.
i tried this solution but the problem is not resolved, it still says the same notification.
i trying to solve this problem for several days!!!
please help me if you know how!!!
thanks a lot in advanced!
Asaf,
I've had literally hours of frustration dealing with similar problems. The solution can be a challenge to track down, because there are numerous reasons you could be having the problem. I'm no expert myself, but I'll try to pass on some of what I've learned.
First, you mentioned getting an error about Rake, but didn't mention that you had tried to actually run Rake. Are you getting the error upon loading up RubyMine or specifically after running a Rake command?
Next, if you are running a Rake command and getting an error, you should take note that WHERE you run the command from is pretty important. For example, if you keep a Terminal window open like I do, and run the Rake command from Terminal, you won't necessarily get the same results you would get by running Rake from RubyMine itself. The reason for this was not self-evident when I first started with RubyMine, but I think it comes down to this:
The Ruby SDK and Gems preferences in RubyMine should be determining what types of dependency errors you get from within RubyMine. So you might start by looking there to see if there are any dependency errors. Next, I would guess that you're running RVM? Please be aware that it is completely possible to be using one RVM set in RubyMine (check the Ruby Interpreter in SDK and Gems Preferences to see which one you're using) and an entirely different RVM in Terminal (the command "RVM info" should get you the version you're using). If those don't match, you could very well get different results from both RubyMine and Terminal, even when running exactly the same commands.
My solution to this problem was to carefully ensure that both of my environments matched. I think you can set RVM defaults by typing "rvm default" plus the version you want to default to. That way both your Terminal and RubyMine environments match.
Lastly, be aware that RubyMine allows more than one version of a Gem to be installed at the same time. So, if you're getting an error that a Gem is failing because some dependency requires a specific version, you can tell RubyMine to install multiple versions. Do this thru the SDK manager, select the Gem, then click "Select Versions".
Hopefully some of this information applies to your issue. I sort of did the shotgun approach, because I'm not really sure what is causing your error, but maybe some of this can put you on the right path. One final note would be this: Use your Gemfile to control Gem versions, if need be. I've spent hours of frustration over broken dependencies, only to discover that the reason for the break was me telling RubyMine to update all my Gems to the latest version. The latest version of a particular Gem isn't necessarily backwards compatible with previous versions, and blindly updating Gems can cause huge problems.
Asaf, you should delete rake.gemspec and run gem install rake to get problem fixed

How can I get the jruby version at runtime?

I need to get the jruby version for logging & debugging purposes.
I tried looking around JRuby.runtime for a version method, but I didn't find anything useful.
I also thought about using %x{jruby -v}. It works in most cases, except that there is always the possibility that more than one jruby version are installed, and I want to get the version of the currently running interpreter.
Did I miss something? Any suggestion?
You are looking for the global constant JRUBY_VERSION. This is a brother of VERSION, RUBY_ENGINE (not available under 1.8.x), RUBY_PLATFORM, etc.

Resources