I'm totally new to Ruby but I'd like to use it for a small application I've in mind.
But I'm struggeling at the beginning: How can I use the library "flickraw" in order to access the flickr api within eclipse?
I've managed to update ruby to 1.9.3 but in eclipse I found only an older interpreter (1.8).
Could someone please tell me how I can show eclipse where ruby 1.9.3 is installed?
Beside of that, how can I use this flickraw library in eclipse? I only know how to import jar's for a java project but not how to do it for a ruby project :(
Could someone please tell me how I can import a external ruby library into eclipse?
Machine: Mac OS X Mountain Lion,
IDE: Eclipse Juno,
flickraw library: http://hanklords.github.com/flickraw/
many thanks!
You've probably already answered your question (being 6 months ago), but I answer this to help future generations of Eclipse Rubyists who come upon your question.
I assume you're using Eclipse RDT (Ruby Development Tools). I'm using Eclipse Juno (4.2.1) on Windows, but the menu items should be the same on any OS for similar versions of Eclipse.
To change or set your Eclipse Ruby interpreter:
Go to "Windows" > "Preferences"
Click the "Ruby" entry on the left pane of the "Preferences" window
Click the "Interpreter" subentry (also on the left pane)
Click the "Add" button
Click "Browse" by the Interpreter Executable text box
Now find your Ruby executable - I used RailsInstaller on Win7, so mine is in C:\RailsInstaller\Ruby1.9.3\bin
If you found a good executable, Eclipse should figure out the rest of the interpreter information itself
To import Ruby libraries into an Eclipse project: I'm not sure per se. This is what led me to your post. I thought I needed to import all my gems by hand. But when I used the gem installer ("./gem install targetgem") and restarted Eclipse, Eclipse was magically aware of the gems. (I'm not sure what dark magic allowed Eclipse to do that.)
Hope this helps future Rubyites.
Related
I recently downloaded RubyMine 7.1. This is my first time using Ruby. I am trying to add an interpreter to my first project. When I go to Settings -> Languages and Frameworks -> Ruby SDK and Gems, and I try to add an interpreter path, it says "The selected file is not a valid home for Ruby SDK." What does this mean and how can I add an SDK?
Probably you are using a Ruby SDK version that is not supported by the RubyMine.
Try downgrading Ruby, and configuring IDE again.
I'm using eclipse for ruby development and I have installed the Ruby Development Tools plugin. Seems eclipse doesn't auto-complete required gems, for example
require "gemA"
a = gemA.new
a. # no auto-completion
Is there a way to make it work in eclipse?
You may want to check out JetBrain's Ruby Mine. It's not free, but I've heard it's worth the money.
Also, I doubt eclipse has auto-completion for that plug-in. To make sure, check your IDE preferences that auto-completion is enabled.
I'm new to Rails and need to get my Eclipse DLTK highlighting working.
It is occasionally giving syntax error, unexpected ':' for hash colon notation. Though the application runs fine.
I'm using Eclipse Indigo and the Ruby Development Tools.
So, unfortunately, this is still an issue in Eclipse, and it's driving me crazy.
Both the Eclipse DLTK project (for both Indigo and Juno) and the Aptana Studio plugin for Eclipse -- all have this issue.
Here's the relevant bugs, still open and unaddressed:
1) https://bugs.eclipse.org/bugs/show_bug.cgi?id=386350
2) http://jira.appcelerator.org/browse/APSTUD-4405
It's enough to make me overcome the usual switching IDE inertia, so I'm currently evaluating RubyMine (it does not have that syntax error problem, as I just tested, and is an excellent Ruby IDE from everything I've been able to read).
[edit] For what it's worth, I also just submitted a patch for this issue on the dltk.ruby github repo.
As of today, I like Idodds answer best: use DLTK 5.0 which appears to be the only option both (modestly) maintained and (modestly) functional. I had to crawl through some nasty internets to find the answer to "how to actually install DLTK 5.0" since all the search results send you to update sites which gives you DLTK 2.0 at best. I finally found this, which was the best I encountered for getting 5.0 on newer eclipse luna (newer than Kepler which Idodds detailed):
http://download.eclipse.org/technology/dltk/updates-dev/5.0/
When I used that update site (and de-selected "show in groups" since they've misconfigured this plugin). Then I just selected the two options I wanted: "Ruby Development Tools" and "Ruby Development Tools SDK" (which in turn required the core plugin). PLEASE NOTE: I also made very sure to confirm the "Version" looked something like "5.*" which it did in this site (and definitely did not in the others).
PostScript: the other two:
RDT: I've been using RDT for almost a year now with ~0 success. it does a modest job of syntax highlighting, but it does a comprehensive job of crash-and-burning on ruby 1.9 syntax. I wish internet/google would flag RDT as deprecated: a plugin which supports ruby 1.8 and prior really should not be listed in current "ruby" search results.
Aptana gets some very good press, and some very bad press. I should try it, since I need Rails not just ruby, but the bad press seems pretty comprehensive, so I've avoided it. I tried a few times and failed, but of course any non-java eclipse plugin will probably take a few days to make work.
This seems to be mostly resolved now. The main problem I encountered was with the new hash key syntax.
With Eclipse Kepler and DLTK 5.0 there are less errors. The syntax checker seems strict, but now works.
Using the Kepler release make sure you add the following as a Repository in "Install New Software":
http://download.eclipse.org/releases/kepler
Then install DLTK 5.0. The repositories that come bundled with Kepler don't seem to refer to the latest DLTK version which is why this issue looks like its not fixed.
I have Mac os 10.5.8 and Ruby 1.9.2p0, Rails 3.0.1, Netbeans 6.9.1 installed. When i run the project by creating it from existing source code, it says
Error opening script file: /usr/local/src/demo_app/script/server (No such file or directory)
Before it i have edited project in TextMate and run successfully over terminal. I know that with Rails 3.0 there is no script/server but rails server, to run the project. How to fix this issue, is there any way to configure RUN command in netbeans or any other idea is most welcome.
Thanks
I had the same problem. Here is what you can try:
Go to the folder where the gem ruby-debug-ide-0.4.6 (or whatever your version is) is installed.
In the lib folder, edit the file ruby-debug.rb
Locate the method def debug_program(options).
Look for the line bt = debug_load(Debugger::PROG_SCRIPT, options.stop, options.load_mode)
Just before that line, add Debugger.const_set('PROG_SCRIPT', './rails server')
Save file and restart Netbeans.
You may see a warning that constant is being set or something when NetBeans starts the debugger, just ignore that.
Also, you should upgrade to using Rails 3.0.3
I have read that Neatbeans 6.9.1 doesn't support Rails 3 as the underlying command line tools have changed in Rails but the changes were too late for the Netbeans release cycle.
I would recommend, if you are using MRI Ruby (1.8.*) or YARV Ruby (1.9.*) switching to Rubymine if you need an IDE either temporarily or permanently as it fully supports Rails 3 and all of the command line tools that support it. It has good integration with git too and many other very useful version control tools. If you are using any other versions of Ruby I can't say if you will have much success because I don't know.
It also has good refactoring tools and debugging support if you need it.
You can get a temporary 30 day licence from the home page and also keep up to date with development changes at the EAP page, they also offer free licenses if you are doing open source development.
For mac os 10.5.8 you might want to have a look at this thread if you have difficulty installing it.
I don't expect a bounty for this answer as its not an exact answer to your question but its a possible solution.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
RDT (Ruby Development Tool) seems to be the preferred plugin for adding Ruby support to Eclipse. However, I see that the main developer on that project has joined Aptana RadRails. Does this mean that project is no longer up-to-date for Ruby in Eclipse?
If so, which plugin is the preferred and best choice these days?
Try the Dynamic Languages Toolkit for Ruby. It's available from Eclipse's Software Updates panel.
Update May 2020: Ruby support was dropped in DLTK 6.0 in favour of Eclipse Solargraph.
Good question. I've used Aptana/radrails, and that's definitely one to steer clear of.
It writes a database in whatever directory you happen to start Eclipse from, and generally takes over Eclipse, changing a lot of useful key bindings.
One of the most irritating things is that Ctrl-1 stops working in Java files, and that's a hotkey I use all the time.
I'm looking forward to hearing people's answers on this one, because I'd like to know of a good one.
Looks like the update site is here: http://download.eclipse.org/technology/dltk/updates/
I found it on www.eclipse.org/dltk/install.php
I faced this problem after installing aptana studio plugin for Eclipse. So, I decided to try dynamic languages toolkit for eclipse.
If you want to uninstall the aptana plugin: Eclipse > Help > About Eclipse > Installation Details > Installed Software tab > Aptana plugin > Uninstall. This should do a clean, frustration free uninstall.
Now, lets install the DLTK plugin.
Go to link - http://marketplace.eclipse.org/content/ruby-dltk. Press the green down arrow. copy the link from popup.
Eclipse > help > install new software > work with = copied link.
Now you see a list of plugins. In that list,expand the Programming Languages > check the box: Dynamic languages toolkit - Ruby Development Tools > press button: next > obvious steps.
After this, install the RubyInstaller for windows at http://rubyinstaller.org/
Find the location of ruby.exe created by this installation. You will need this to set the ruby interpreter when you create your first eclipse ruby project.
Once you successfully create a Ruby project, eclipse asks you if you want to open the ruby perspective. Say ok. To test if it works, create ruby project, then create an empty ruby script inside this project. Then execute this command puts "hello ruby" as a ruby script. Enjoy sparkling ruby !
I have used Aptana/RadRails in the past and thouroghly enjoyed it. I suggest giving it a try. There is a standalone Eclipse plugin available that supports non-Rails projects decently as well if that's what you're going for.
My only experience with Eclipse was through Aptana, however, so there may be other considerations.
Dynamic Languages Toolkit (DLTK) is the preferred. step-by-step installation in eclipse:
Open eclipse
Go to Help -> "Eclipse Marketplace..."
Type DLTK on Find text box and click Go button
Click Install button under Ruby (DLTK) section
Follow the instruction in eclipse pop-up
Verification of installation after successful installation:
Go to Window -> Preferences and you would see "Dynamic Languages" and "Ruby" are enlisted on the left panel