Errors/Warnings in Ruby Wordnet Gem - ruby

I've noticed that there are a lot of errors/warnings with the ruby Wordnet gem.
Does anybody know how to get rid of them? Or if the Wordnet gem is being actively maintained? There also seems to be errors using the Wordnet gem with Ruby 1.9.2 (which I've been able to get around following steps in https://gist.github.com/1779371)
Thanks

Maybe have a look at the rwordnet gem instead?

Related

Getting newer gems

I'm really just a beginner to ruby, so hopefully this is an easy one. I've got to the point where I'm starting to look into some of the gems that the community have put together. I decided to check out something that would help my application consume rss feeds. So, headed over to rubygems (which is where i thought people go to get these kinds of things) and searched for rss. I found this one;
http://rubygems.org/gems/simple-rss
instructions were to just install the gem with
gem install simple-rss
So far, so good. When i came to actually use the gem, the documentation I received from doing the above was a bit naff, so i searched a bit further and found the git repo;
https://github.com/cardmagic/simple-rss
The documentation there (their code examples) complain about missing methods etc. and after a bit of digging I came to the conclusion that I must have downloaded an older version of the gem than the git trunk.
So, my question is, should I be using rubygems to get the latest gems, and if not, what other resources are out there to help find the latest builds of the comminities gems?
As far as finding a good gem for a task — use Ruby Toolbox, since it also shows you how actively maintained a gem is. Here's, for example, a section on feed parsing.
If you want to get the latest gem code that hasn't been released yet, you could download the code directly from github and build the gem yourself. However, it's easier to use bundler for that. It allows you to create a Gemfile for your project looking something like the following.
gem 'simple_rss', :git => "git://github.com/cardmagic/simple-rss.git"
Then run bundle command to download and build these gems from their corresponding sources.
In general, bundler is a great solution for managing gem dependencies for any ruby project. It provides ways to quickly reference any released gems, automatically builds gems directly from a git source, git refs, or paths on your filesystem, and has other convenient features.
By far the best place for all things Ruby & Ruby on Rails for the devs is the Ruby Toolbox

Ruby gem for writing formulas in xls/xlsx spreadsheets?

Is there a Ruby gem that can write formulas to an xls/xlsx spreadsheet? The Spreadsheet gem doesn't appear to allow this, at least not in the latest version. Are there any gems out there that allow this or am I stuck doing it in a csv file?
Thanks,
Ben
I had this exact same problem and there is a gem that will do this for you!
Check out writeexcel. It will write all those formulas you have been missing. Here is an example of how it works:
worksheet.write('B5', '=SIN(B4/4)')
Hope this helps!

Nothing known about.... when trying ri String#upcase Ruby

I have just installed the RVM and I am reading The Well-Grounded Rubyist book. In the first chapter I am supposed to try ri String#upcase to view documentation on the upcase method, however I get a message saying:
Nothing known about String#upcase
I found some posts here on SO telling me that it probably is because RDoc is not installed. However I do not understand how to fix it.
I am using Mac OSX 10.6, and latest RVM. I have only installed 1.9.2, in addition to the standard Ruby interpreter which come along with the Developer kit from Apple.
Did you generate the docs?
rvm docs generate
https://rvm.io/rubies/docs/
RDoc is installed, I'm not sure why that particular lookup does not work. Perhaps somebody else can shed some light on that.
However, if you just need to find out about how to use particular parts of the API, you can't go wrong with a google search. All of the Rdoc documentation is available online from numerous locations.
Here's String#upcase for example: http://ruby-doc.org/core/classes/String.html#M001155
It might be that docs aren't working because you're using the latest ruby version, 2.1, in which rvm has some problems. It doesn't generate docs, thus you can't retrieve the docs with ri.
**Error: **
Your ruby version 2.1.2 is not supported, only 1.8.7, 1.9.2, 1.9.3,
2.0.0

Ruby Reporting through Ruport and other tools

I want to write a small reporting tool and looking to fetch data from MySQL. After searching I found a tool called as Ruport but I am not following where are it's binaries located. If not binaries than how to install it. It discusses the installation commands to install via gems, but where are the files located.
Secondly, do I have to create a Windows interface using fxRuby or wxRuby to work with it?
Are there other free reporting tools for Ruby?
It's probably a good idea to get a good book or two on Ruby, rather than asking these kind of questions, but here goes:
To install a gem, do
gem install gemname
To use it, put the following in Ruby code:
require "rubygems" # May not be necessary
require "gemname"
To find where your gem files are stored, do
gem env
And as for whether you need a GUI for ruport: can you try working that out yourself first?

How to get Shoes to use an already installed gem?

I have a ruby gem I created and installed and want to be able to use it in a Shoes app. As expected, Shoes reports it cannot find the gem, understandably since the gem is only installed for the standard ruby distribution. Can help pointing towards documentation explaining how to get Shoes to find this gem would be most appreciated.
Thanks.
Unless things have changed since _why left, this is not possible. Shoes is a separate Ruby installation and therefore needs its own gems.
To install a gem, you can do something like this at the beginning of your Shoes app:
Shoes.setup do
gem 'json'
end
Edit: there's also this previous SO thread:
Using Ruby libraries and gems with a Shoes app
U can think Shoes as a ruby-distro, like jruby or other rubies, it maintains its own gems.
therefore you will need to install it via shoes way like Michael Kohl said

Resources