Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA "Cannot find 'require'"

When using the Ruby plug-in with IntelliJ, what "undefined reference" warnings should I expect/tolerate, and which indicate that I don't have something configured correctly?

For example, I am getting "Cannot find" warnings for 'require', 'File', and 'FileUtils'. I suspect that this indicates a configuration problem.

I am also getting warnings for RSpec methods like 'describe', 'before', 'after, and 'it'. Should I also be able to configure IntelliJ to "find" these?

like image 537
Zack Avatar asked Mar 29 '16 13:03

Zack


People also ask

How do I view non project files in IntelliJ IDEA?

Press Shift twice to open the search window. By default, IntelliJ IDEA displays the list of recent files. Pressing double Shift again or Alt+N for mnemonics will select the Include non-project items checkbox and the list of search results will extend to non-project related items.

How do I find a class in IntelliJ IDEA?

Ctrl+N: finds a class by name. Ctrl+Shift+N: finds any file or directory by name (supports CamelCase and snake_case ). If you have a directory or a file that you excluded from your project, IntelliJ IDEA will not include it in the search process. Ctrl+Alt+Shift+N: finds a symbol.

Is IntelliJ IDEA only for Java?

While IntelliJ IDEA is an IDE for Java, it also understands and provides intelligent coding assistance for a large variety of other languages such as SQL, JPQL, HTML, JavaScript, etc., even if the language expression is injected into a String literal in your Java code.

How do I search in IntelliJ?

IntelliJ IDEA lists the results dividing them into sections where your query is found.Press Ctrl+Up or Ctrl+Down (⌘↑/⌘↓ on macOS) to jump between sections. Click to list the search results in the Find tool window. Press Tab to switch the scope of your search to classes, files, symbols, or actions.


1 Answers

You need to select the Ruby SDK in the Project Strucure (Ctrl + Alt + Shift + S by default).

Unfortunately it does not solve the warnings for rspec related words.

like image 65
Jeremie Zazoun Avatar answered Sep 20 '22 20:09

Jeremie Zazoun