Beginner completely baffled by RubyMine not recognising stuff

已回答

I am a long time Java developer that uses IntelliJ Ultimate daily. I wanted to look into Ruby / Linux / GTK. Since I have the 'all products' subscription I figured I'd give it a try. I am attempting to follow this tutorial but it's hopeless with RubyMine - it works just fine from the command line:
https://opensource.com/article/18/4/creating-linux-desktop-application-ruby

I have tried in both InitelliJ and RubyMine. I have installed various versions of Ruby using rvm (2.3.x, 2.4.4 and 2.5.1), none of which made any difference. I have (to my knowledge) told the IDE which SDK to use it for my project and yet this simplest of code has all sorts of problems according to RubyMine. How do I make the IDE code sense work??

I am using the latest versions of InteliJ and RubyMine as of today (IntelliJ 2018.1.2, I'm not at the computer with Rubymine installed)

In this screenshot we can see that although it thinks it is happy with 'Gtk::Application' it clearly isn't because things like 'signal_connect' are all unknown. Again, even though it appears to know about 'Gio', it certainly doesn't know about 'ApplicationFlags' and yet no end of internet searching tells me that there is anything wrong with that? Indeed all the code I look at uses that example.

Here's my Gemfile all I've done is add gtk3, otherwise it's the default

And finally, here's my module config.

Note that given I'm completely new to Ruby, I could easily be doing something wrong but I don't really want to ditch the IDE to learn.

0

While I'm at it - here's the applcation working. You can see the script used to start the application, the GTK Hello World window and the terminal used to start it.

How do I get IntelliJ / RubyMine to recognise that the script file contains Ruby?

0

Hello Martin,

sorry for the delay. It appears that there's no navigation because those methods are dynamic and in this case we have a corresponding request on our tracker: https://youtrack.jetbrains.com/issue/RUBY-14580

0

Delay??!! Given it was 11 months ago I can't even remember why I was looking at Ruby, let alone what I was trying to do! I'm glad it wasn't work related.

0

请先登录再写评论。