IntelliJ IDEA "Cannot find 'require'" - ruby

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?

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.

File > Project Structure > Project > Select Ruby SDK

Related

Getting unknown property error when I try to use new Gradle 7 version catalogs

I tried to implement the simplest possible example to better understand
Gradle 7 version catalogs. I used 'gradle init' to generate a new application,
then I followed the steps presented in this blog post ->
https://melix.github.io/blog/2021/03/version-catalogs.html exactly as I could.
The result, when I tried to import the project into Intellij (and also when I simply ran 'gradlew test' at root directory of project) was the error
below. I'm guessing it is more likely that the
feature works and I did something dumb, than the feature is broken. Any
sharp pair of eyes that can help me spot the dumb thing?
ERROR I GOT
A problem occurred evaluating project ':app'.
Could not get unknown property 'testDependencies' for extension 'libs' of type org.gradle.accessors.dm.LibrariesForLibs.
WHAT I DID
Generate a simple Gradle example app via gradle init, as below:
Select type of project to generate:
1: basic
2: application
3: library
4: Gradle plugin
Enter selection (default: basic) [1..4] 2<RETURN>
Select implementation language:
1: C++
2: Groovy
3: Java
4: Kotlin
5: Scala
6: Swift
Enter selection (default: Java) [1..6] 5<RETURN>
Split functionality across multiple subprojects?:
1: no - only one application project
2: yes - application and library projects
Enter selection (default: no - only one application project) [1..2] 1<RETURN>
Select build script DSL:
1: Groovy
2: Kotlin
Enter selection (default: Groovy) [1..2] 1<RETURN>
Project name (default: stacko):<RETURN>
Source package (default: stacko):<RETURN>
Add the version catalog definition where they say it should go (exact content as in blog post)
cat <<EOF >gradle/libs.versions.toml
[libraries]
guava = "com.google.guava:guava:30.0-jre"
junit-jupiter = "org.junit.jupiter:junit-jupiter-api:5.7.1"
junit-engine = { module="org.junit.jupiter:junit-jupiter-engine" }
[bundles]
testDependencies = ["junit-jupiter", "junit-engine"]
EOF
Enable the preview feature
echo "enableFeaturePreview('VERSION_CATALOGS')" >/tmp/stuff
cat settings.gradle >> /tmp/stuff
cp /tmp/stuff settings.gradle
Then I added this (WRONG) line as the last line in my dependencies { } block (see accepted answer for correction):
testImplementation(libs.testDependencies)
Tried to import into Intellij and got the error shown in ERROR I GOT, above.
Replace libs.testDependencies with libs.bundles.testDependencies and it'll work. Maybe a typo in the blog post or a last minute change. The Dependency Bundles documentation is correct.

Please solve appcompat_v7 error

My Android Support Library is properly installed by SDK Manager.
Using this link I doing this procedure.
Selecting Adding Library with recources - Using Eclipse > doing these procedure.
After I finish, created "android-support-v7-appcompat" file in Eclipse.
android-support-v7-appcompat > res > values-v21 > styles_base.xml >
<style name="Base.Widget.AppCompat.ActionButton"
parent="android:Widget.Material.ActionButton">
</style>
this line creating with error. How I can fix this problem?
I read some question about appcompat_v7 error but I can not fix it yet.
Please tell me effective way to solve it forever.
You need to remove the android-v4 jar file under the libs folder,and add it from the android-support-v7-appcompat libs folder. I had this problem before,and I found it so annoying!
If in console the error is
Error retrieving parent for item: No resource found that matches the
given name 'android:Widget.Material.ActionButton'
, on android-support-v7-appcompat library project choose Properties/Android/Project Build Target and set checkbox on Android 5.0 to solve.

How to run buildr tests with -ea flag (enable assertions)

Does anyone know how to enableassertions during testing? I'm trying to use buildr to for a lucene based project and I get the following exception:
[junit] Test class requires enabled assertions, enable globally (-ea) or for Solr/Lucene subpackages only:
I've tried from the command line:
JAVA_OPTS=-ea buildr
and putting the following in my buildfile:
ENV['JAVA_OPTS'] ||= '-enableAssertions'
I'm using the java version of buildr (1.4.12)
ugh, 2 seconds after submitting this I figured out the solution:
test.using :java_args => [ '-ea' ]
I had same issue with SOLR and eclipse, solution is exactly the same.
In package explorer right click on project:
Run As->Run Configurations...->JUnit->ProjectName->Arguments(second tab)->VM arguments
Type in :-ea

Compile iReport 4.0.2 from sources with NetBeans 6.5.1 java.io.IOException

I am trying to compile iReport 4.0.2 with NetBeans 6.5.1. On the iReport forums it says that this is the NetBeans platform to which it is compatible.
However, I get this error when compiling the project:
C:\Program Files\NetBeans 6.5.1\harness\suite.xml:106: The following
error occurred while executing this line:
C:\Program Files\NetBeans
6.5.1\harness\build.xml:98: java.io.IOException: No definition of netbeans.dest.dir in
V:\iReport-4.0.2-src\iReport-4.0.2-src\jasperreports-components
This is the line 106 in suite.xml
<subant target="netbeans" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false"/>
This is the line 98 in build.xml:
>
... it is basically closing an xml start tag (parseprojectxml) - this is the context of the line (the single angle bracket):
<parseprojectxml
project="."
publicpackagesproperty="public.packages"
friendsproperty="friends"
javadocpackagesproperty="module.javadoc.packages"
moduledependenciesproperty="module.dependencies"
moduleclasspathproperty="module.classpath"
publicpackagejardir="${public.package.jar.dir}"
modulerunclasspathproperty="module.run.classpath"
classpathextensionsproperty="class.path.extensions"
>
<testtype name="unit"
folder="test.unit.folder"
runtimecp="test.unit.runtime.cp"
compilecp="test.unit.compile.cp"
compiledep="test.unit.testdep"/>
<testtype name="qa-functional"
folder="test.qa-functional.folder"
runtimecp="test.qa-functional.runtime.cp"
compilecp="test.qa-functional.compile.cp"
compiledep="test.qa-functional.testdep"/>
</parseprojectxml>
I also faced the above problem in iReports trunk version (> 4.6.0). After marking off read only mode (which the solution of previous answer do), you might need to add
<nbmproject2:property name="netbeans.dest.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
in jasperreports-extensions and MongoDbPlugin.
Gaurav J
The problem was somehow solved by opening each module in NetBeans IDE, then opening the properties dialog and clicking OK for each module. I restarted the IDE and then I managed to run the project.
If someone can exaplain what caused the problem and why my actions managed to solve it... I would like to have an explanation for this behavior.
Thank you!
I can compile ireport with NetBeans success.I think you must modify file with name "platform-private.properties"

Compile Liferay under os x 10.6

Hi i'm trying to build Liferay from source, i've downloaded liferay-portal-src-5.2.3.zip but when i go in and press "ant start" i got 3 errors:
SampleSQLBuilder.java:139: cannot find symbol > _counter = new SimpleCounter(counterOffset);
EditServerAction.java:401: cannot find symbol > Log4JUtil.setLevel(loggerName, priority);
EditUserPortraitAction.java:102: cannot find symbol > PortletRequestUtil.testMultipartWithCommonsFileUpload
I've tried switching compiler using build.properties but nothing seems to work. Can you help me ?
I've solved the problem. I had some conflicts in my classpath. I've cleaned /System/Library/Java/Extension and /Library/Java/Extensions and everything goes right!

Resources