gem

How to enter a remote directory on Ruby NET:SFTP ?

How to enter a directory like the command - cd, thus operate remote files without a path prefix ? Here is my current code. Net::SFTP.start do |sftp| sftp.rename!(REMOTE_PATH + "latest.zip", REMOTE_PATH + "latest.back.zip") sftp.upload!("latest.zip", REMOTE_PATH + "latest.zip") end I would like to have: sftp.cd REMOTE_PATH ...

Best rails plugin for comments?

What is the best plugin or gem for adding comments to the ActiveRecord models in rails? Maybe there is one with ability to rate each comments with votes +1/-1 (like on youtube for example) and a cool view helper to display comments in a tree? ...

acts_as_audited. How can I add a "comment" column

Hi guys, I am using the acts_as_audited gem with my application. (Excellent gem to keep track of changes of model objects) I have been asked to support associating a text comment with each Audit record (similar functionality to svn commit). And I am stumped on how to accomplish this. For example. Lets say I have an address form, and...

aws-s3 can't find xml-simple, but in gem list

I'm transitioning to heroku, and need to have AWS-s3 connections to deal with a variety of graphics. I've installed the aws-s3 gem, but one of its dependencies is not being found: xml-simple. My belief is that this is a standard part of RoR, and it is in the gem list. When I deploy to heroku, all is fine, but on my development server, i...

Rails gem with javascript files

I'm trying to create a ruby gem for rails out of a plugin I've created. The problem is that my plugin 'shortcuts' uses a few javascript files which need to be in the public/javascripts directory to work. What's the best way to make these javascript files which are in the gem I've created accessible by which ever project requires my gem...

Installing bcrypt-ruby gem on Windows

I'm trying to install bcrypt-ruby on Windows Vista. So far, I have been able to install nmake.exe from a MS knowledge base article and cl.exe from installing Visual Studio 2008 Express. However, I am now encountering this error: cl -nologo -Wall -I. -IC:/InstantRails/ruby/lib/ruby/1.8/i386-mswin32 -I C:/InstantRails/ruby/lib/ruby/1.8/...

How to remove a remote source from gem remote sources

I have added gemcutter.org to my Rubygems sources, and now I do not know how to remove it. $ gem sources *** CURRENT SOURCES *** http://gemcutter.org http://gems.rubyforge.org/ ...

Problem with Ruby Gem and Sanitize

Hi, I'm trying to install the Ruby gem sanitize. I've already installed nokogiri: >gem list nokogiri *** LOCAL GEMS *** nokogiri (1.4.0) but when I try and install sanitize I get the following error: >gem install rgrove-sanitize ERROR: Error installing rgrove-sanitize: rgrove-sanitize requires nokogiri (~> 1.3.3, runtime) ...

Ruby require problem

I'm trying to get the sanitize gem up and running. I've installed sanitize and nokogiri 1.3.3 as required, but when I try and use it in my application_helper.rb: require 'rubygems' require 'sanitize' I get the error: MissingSourceFile no such file to load -- sanitize RAILS_ROOT: C:/Ruby/GWS (stack trace) This error occurred while ...

Ruby AlterEgo: Is there a way to find out what was the transition called in on_enter/on_exit/anywhere?

As title, I am talking about the alter-ego gem (http://alter-ego.rubyforge.org). I need to determine if I am going to execute my validation depending on the transition called. The best alternative I have now is add a callback to transition, but that's rather clumsy as I have to do it on every transition. ...

Can't work with more recent gems

Hi all, I'm working on a university project and my teacher set up the server for it, but after installing Ruby 1.9.x we had to return to Ruby 1.8.x, because of the Ruby 1.9/Rails 2.3.4 problem. Now, every time I build a Rails app, it's always using Rails 2.2.3 gems. I've changed the environment.rb (RAILS_GEM_VERSION = '2.3.4' ...), bu...

Can't install gemcutter as a Ruby Gem source

I'm trying to install the thinking sphinx gem, which is on gemcutter.org When I run the command gem sources -a http://gemcutter.org I get the error: Error fetching http://gemcutter.org: bad response Not Found 404 (http://gemcutter.org/specs.4.8) If I change the above URL to http://gemcutter.org.specs.4.8.gz it finds a file. How do...

raise MysqlError; raise Mysql::Error both work, how did this happen?

Greetings, I was working on mysql exceptions and I came across this interesting issue, in which a raised exception is responding to two different exception names. How did this happen? -daniel #!/usr/bin/env ruby require 'rubygems' require 'mysql' require 'yaml' require 'pp' $config = YAML.load_file 'database.yml' class ExceptionPr...

Ruby gems repository

I'm trying to set a gem repository on one of our local servers. Here are the steps I'm running, that I've followed from several guides. 1) I create the BASEDIR folder /var/www/html/gems 2) sudo cp -r /usr/lib/ruby/gems/1.8/gems/someGem /var/www/html/gems 3) sudo gem generate_index -d /var/www/html/gems However, when I run this, I get...

How to find if a gem is a library?

I tried adding a few gems to my Rails app using the config.gem instruction in environment.rb so that when the app gets deployed on a new system, the missing gems issue can be taken care of with rake gems:install After adding the list of required gems that my app depends on, my app failed to start. If I remove the list of required gems f...

How can I show updates with gem?

Hi I want on my webserver a script that checks automatical over cron if there are gem updates without installing updates. I don't find anything about this task in the gem docs. ...

Ruby net-dns reverse lookups

I am trying to get reverse DNS lookups working with the net-dns gem for ruby. From the rdoc res = Net::DNS::Resolver.new ip = IPAddr.new("172.16.100.2") packet = res.search(ip) packet = res.search("192.168.10.254") should work but I'm getting ArgumentError: invalid address for the last two lines. This happens using a custom ge...

How do I make --no-ri --no-rdoc the default for gem install?

Hopefully the title says it all - I never use ri nor rdoc and they take too long to install. Is there a config file somewhere that will let me do this ...

Ruby web spider & search engine library

I'm looking for a Ruby library or gem (or set of gems) which will not only do spidering, but also collect the data into, say, a database, and allow basic searches on the data (i.e. a typical web search). I've found several spidering libraries, so that part seems well covered (I was going to try Anemone first), but I can't find anything ...

Problem installing metric_fu related with flay.

hi i have installed metric_fu om a rails 2.2 system running hobo and i just can't get to run the metrics command. this is my log: $:apfcool $item rake metrics:all (in /Users/$/Documents/apf/apfcool) * master /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:171:in `process_sexp': undefined method `<' for nil:NilClass (NoMethodError) ...