Intellij IDEA Ruby Language Level - ruby

I got a Rails Project in intellij idea but somehow the language level seems to be set on 1.8. I got the following configuration:
But it still shows the following error:
Am I missing something? When I had problems with the colon syntax before, it was always the language level.
Thanks,
Robin

I still don't know what the problem exactly was but I guess it had something todo with binstubs. What I did:
I opened the project in RubyMine, where I got the warning: "no ruby interpreter configured for the project", though the correct rvm ruby was selected
I deleted the .idea folder and the bin folder
I opened the project in RubyMine again, this time it correctly recognised the rvm ruby
I opened the project in Intellij IDEA, everything works fine here too.

The answer is given by rweng:
Remove .idea folder
File/New/ProjectFromExistingSources
Maybe deleting the module and recreating the same might also help

Related

IntelliJ Idea Ultimate red-underlines Ruby shorthand hash literal

Anybody know why IntelliJ Idea Ultimate doesn't like Ruby hash literals in the newer syntax? Refer to the red underlines in my screenshot from the IDE below. Syntax:
{key1: "value", key2: 123}
Really annoying as it means my entire project has a red underline all the way up the directory tree.
I have setup a Ruby SDK version greater than 1.9 (which is when i think the new hash literal syntax was introduced) in the IDE preferences, so there is no excuse!
Thanks.
How I fixed this in Intellij 14.1:
File -> Project Structure
Delete the existing module which defaulted to Java (doesn't delete the actual files)
Use green + button to create a new module with same name/location, but this time associated with Ruby on Rails instead of Java (with correct SDK)
File -> Close Project
Reopen project.
Previously I tried just changing the project SDK from the default of Java to Ruby, but this didn't fix the issue.
Under OSX IntelliJ 14 I was able to fix this by closing the project and reopening it.
In fairness, I did try setting the project's "language level", but it only shows Java SDKs, which shouldn't affect my main Ruby module.
This seems to be a bug in the Ruby plugin: http://devnet.jetbrains.com/thread/457333
Anyone who doesn't feel like changing his code base, the following steps resolved the issue for me:
Open File -> Project Structure
Open the Project Tab
Change the Project Language Level
Click OK
IntelliJ now asks if you would like to reload your project. After doing so the "new" Hash Syntax is considered correct...
Edit: It doesn't really matter what you select as language level as it is only relevant for Java code, but apparently this triggers something in the code parser...
What helped me in my case:
Open File -> Project Structure
Remove current using module
Import module ( set path to your project)
Intellij did rest for me
dsager's answer no longer works in Intellij Idea 14. I believe they added the ability to switch language levels without having to reload (great for java development, but breaks this). It's a lame workaround, but the only way I have found now is to create a new ruby project and then move all of your existing sources into it. Something like the following:
PROJECT=my_project
cp -lr $PROJECT ${PROJECT}2
rm -rf ${PROJECT}2/.idea ${PROJECT}2/*.iml
Create new ruby project 'my_project' with appropriate SDK, then:
mv ${PROJECT}2 $PROJECT
Side note: They made Idea's 'Open' command more flexible in 14 in that you can open any directory... much like that of RubyMine. It's quite convenient for opening anything that's not a java project, but this one is annoying.
Answer is to replace every usage of the horrible new hash syntax with the old one using a regex (not perfect yet but works ~95% of the time).
files=gfind . -iregex '.*\(rb\|haml\)' -printf '%p\n'
for file in $files
do
gsed -i "s/([a-z_]+):{1}\s+(('\|"'"'")\?[-a-zA-Z0-9{}:#]+('\|"'"'")\?)/:\1 => \2/g" $file
done

Installing and Using Pantomime Framework... Pantomime/Pantomime.h not found

I just downloaded and compiled Pantomime for SMTP use in my Cocoa Application. The first issue was that it is old... so I changed the build settings to use the most recent SDK as well as eliminate the old PPC build settings.
After those changes, everything compiled nicely (or at least appeared to do so.)
Next, I installed the Pantomime.framework into the /Library/Frameworks directory per Apple documentation recommendations.
Then, I imported the framework into my project under the Build Phases tab where it says "Link Binaries to Libraries".
So far everything seemed to work as it did with WebKit.framework, and ScriptingBridge.framework.
Finally, I added the following to my code:
#import <Pantomime/Pantomime.h>
I got as far as "Pa" when it auto completed the rest, so it apparently knows what I'm looking for. However, when I try to compile my code, I receive the following error:
Lexical or Preprocessor Issue "Pantomime/Pantomime.h" file not found.
All of the other frameworks seemed to work, but this one does not, and I really don't know why (I'm relatively new to working with frameworks.)
Anyone have any ideas on what I'm doing wrong here?
Thanks!
I've never used Pantomime, but this happens to me all the time with Xcode, so although I'm a newbie to development in general I'd wager it's just a bug with Xcode. Here's how I fix it:
In Xcode, hit command-1 to switch to the Navigator's file/folder view.
Reveal the Pantomime.h and .m files in the Finder, wherever you've stored them.
Drag them into the Navigator.
Xcode will prompt you to confirm adding again, and I usually leave it set as is to "copy files if needed".
Xcode will import. You should then delete the old references in the Navigator. It should work fine after that.
I have met this problem.
The solution is setting 'Build Settings' --> 'Header Search Path' Value where your pantomime is. Good luck!

MonoDevelop on Ubuntu -- No compiler, no debugger, nothing... why?

I've tried to use MonoDevelop 2.4 and 2.6 with Ubuntu 11.04, but neither of them seems to actually provide any way of running the project. (As the picture shows, the Run, Step, and Debug items are disabled -- both on the toolbar and inside the menus.)
This is true for all project types I've seen so far -- C#, Python, etc...
But mono-debugger is installed. Is there some post-setup task that I need to do manually, for this to work?
Looking over https://github.com/mono/monodevelop/blob/master/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
Perhaps you haven't selected a 'Project'? Open up the Solution pad and click on the Test1 project (not the solution at the root of the tree, but the project just below it).
I'm just guessing here since I don't have Ubuntu and can't actually test anything.
Edit: actually, it looks like clicking on the Solution would work as well.
From looking at the code, another possibility is that you don't have a build target? Not sure how that would happen, but unless you only opened Main.cs and not actually Test1.sln, I don't know what to suggest.
When you opened the project, which file did you open? Test1.sln? Test1.csproj? Or Main.cs?
Try looking for mono-mdb and more packages in synaptic, this may fix this issue.
Don't remember exact names, Linux box at home...
Did you really open the project? It looks like you just opened Main.cs. It won't work that way.
Make sure you installed the compilers (mcs etc)

Problem in plug-in development: Eclipse 3.4 can't find a bundle that is definitively there!

Today I had a problem with my old Eclipse 3.4 installation and I had to re-download the entire package. However, I don't think that I got the exact package as before, and I'm having some problems.
The problem can be summarized as follows: when developing a plug-in, I cannot resolve dependencies towards 'org.eclipse.jdt.ui'. When trying to add the missing plugin, in the dialog the closest match is 'org.eclipse.jdt.ui**.source**'. A similar thing happens with other core plugins.
In order to test, I created a new plug-in using the wizard and I obtained a non-compiling plugin: one of the classes uses the class org.eclipse.jdt.ui.JavaUI and it cannot be resolved. Similarly, the MANIFEST.MF includes a dependency towards 'org.eclipse.jdt.ui', but the 'Bundle 'org.eclipse.jdt.ui' cannot be resolved'.
Now a summary of my platform:
I'm running Mac OS X 10.4 Tiger and Java 1.5.0_19-138
I'm running Eclipse Version: 3.4.1 Build id: M20080911-1700
I downloaded the modeling package, which comes in a file called 'eclipse-modeling-ganymede-SR1-incubation-macosx-carbon.tar.gz'
I've performed a fresh installation, in a new folder and using a new workspace.
If I look at the Plug-in Registry view, I can find the 'org.eclipse.jdt.ui' plugin in there, and it appears to be running. By the way, if it is disabled, then the workbench breaks and stops working.
I cannot understand what is happening. Is my installation broken? I wonder if the Eclipse package that I downloaded has an error and they included the sources instead of the compiled files. But in that case, the plug-in shouldn't be working in the workbench, isn't it?
In any case, why I cannot find the plug-in when I'm adding the dependencies, even if I see it in the Plug-in Registry?
Thanks for your help!
Problem solved: just restart the computer.
I don't restart my computer very frequently, so it took me a lot of time to find out that this was the solution. After I restarted it, everything started to work perfectly again. It seems that either Eclipse leaves something in the memory after running, or that some of my initial failures had left something nasty behind. In any case, I had checked and there were no Eclipse related processes running .... weird, but at least now it's fixed!

Uninitialized constant error using Ruby in RubyMine

Has anyone used RubyMine who could help me out?
I am new to RubyMine, and when I create my first project and add a few classes and wire them together for a simple meaningless application I am getting this error:
"uninitialized constant RubyApp (NameError)"
But when I take all the classes and put them in one file then run it, it runs fine.
What am I missing about using RubyMine here?
Thanks for the help.
Is "RubyApp" one of your classes?
If so, it sounds like you're not requiring the other ruby files you're creating.
RubyMine pretty much doesn't get in your way at all, although it does like having gems 'attached' to the project.
Not sure if this applies to your case, since I've only run into this issue with gems. But, Rubymine requires you to link the gems your using and what not into your project settings for things to work. At least that is how I remember it when I tried it out.

Resources