rubygems

Should I create a Ruby gem or plugin

I have some logic code that is literally cut and pasted across several different sites I own (it's code that interacts with a web API I've created). Considering that this isn't DRY and that when I update one thing I want it to update across all my sites I wanted to move this to a gem or a plugin. My main question is which one is the be...

uninitialized constant on class from ruby gem

Hello, I am trying to implement a gem called stanfordparser which can be found here: http://stanfordparser.rubyforge.org/ It is a ruby wrapper for a java natural language parser I am developing in netbeans using ruby on rails / jruby on a windows 7 machine. My web app works fine otherwise, but when I try to add the parser wrapper it br...

What to do about failed native extension builds in gem on Windows?

A couple of Rails applications I downloaded have dependencies on bson_ext which appears to be a native code library. When I run rake gems:install for the app I get the following error message: ERROR: Error installing bson_ext: ERROR: Failed to build gem native extension. d:/Ruby187/bin/ruby.exe extconf.rb checking for asprint...

Rails 3 renders Haml file as Html

Following the guide at http://github.com/fortuity/rails3-mongoid-devise I've managed to setup Rails3 with Haml, Devise, and Mongoid. (As a side-note, the guide is really detailed; recommended reading for new Rails users!) Only problem is I can't get Rails to render my Haml views: Started GET "/" for 127.0.0.1 at 2010-07-01 14:40:23 +02...

How/what does the rails bin/rails file do.

Now, I've used Rails enough to know what the rails command does, but how it does it interests me. The bin/rails file (from github) is as follows: #!/usr/bin/env ruby begin require "rails/cli" rescue LoadError railties_path = File.expand_path('../../railties/lib', __FILE__) $:.unshift(railties_path) require "rails/cli" end As...

Could not find RubyGem rake (>= 0) (Gem::LoadError)

Hi, I'm having a hellava time with Rails these past two days. I was using the Rails 3 beta gem yesterday but went back to 2.3.8 and after cleaning the system gems and whatnot I'm just trying to run a simple rake task and I get this: Peleliu:haml jayfallon$ sudo rake install /Library/Ruby/Site/1.8/rubygems.rb:779:in report_activate_error...

Trying to parse a XML using Nokogiri with Ruby

I am new to programming so bear with me. I have an XML document that looks like this: File name: PRIDE1542.xml <ExperimentCollection version="2.1"> <Experiment> <ExperimentAccession>1015</ExperimentAccession> <Title>**Protein complexes in Saccharomyces cerevisiae (GPM06600002310)**</Title> <ShortLabel>GPM06600002310</ShortL...

Handling an XML file with Ruby and Nokogiri

Hello, I am new to programming so bear with me. I have many XML documents that look like this: File name: PRIDE_Exp_Complete_Ac_10094.xml.gz <ExperimentCollection version="2.1"> <Experiment> <ExperimentAccession>1015</ExperimentAccession> <Title>Protein complexes in Saccharomyces cerevisiae (GPM06600002310)</Title> <ShortL...

libcurl on Windows problems

I am having a hard time installing libcurl ruby bindings gem (curb) on Windows. I have done everything right. I have libcurl directory on the PATH, and then I try two ways of installing the gem gem install curb and rake install EXTCONF_OPTS='--with-curl-dir=B:\curl' None of them work. They fail with different errors, though, and th...

Why won't my Ubuntu server install Rails 2.3.8?

I have an older Ubuntu server with a Rails app running on version 2.3.5 that I'd like to move to version 2.3.8. The server doesn't seem to know that there is an update available, no matter how many times I run a "gem update" or "gem update --system" or "update_rubygems" root@server:~# gem install rails -v 2.3.8 ERROR: could not find ge...

Getting executed command from ruby FileUtils

When you pass the :verbose flag to a FileUtils command, the command gets printed to stdout - is there a way to capture the command so it can be logged or used elsewhere? ...

Zlib in Ruby to uncompress .gz

Hello, I have a .gz file that contains an XML document. I was wondering anyone knew how to use Zlib properly. So far, I have the following code: require 'zlib' Zlib::GzipReader.open('PRIDE_Exp_Complete_Ac_1015.xml.gz') { |gz| g = File.new("PRIDE_Exp_Complete_Ac_1015.xml", "w") g.write(gz) g.close() } But this creates ...

Problem in Ruby Gems Source Installation..

I get the following error while performing the following commmand of adding rubygems.orgs as the gem source. I am having Windows XP. C:\>gem source --add http://rubygems.org Error fetching http://rubygems.org: SocketError: getaddrinfo: no address associated with hostname. (http://r ubygems.org/specs.4.8.gz) Please help me out ...

Ruby 1.9.1 isn't recognized on Ubuntu

I wanted to install ruby 1.9.1 instead of the older version so I ran this command on Ubuntu: sudo apt-get install ruby1.9.1-full After the install was complete, I got the following error(s): WARNING: Installing to ~/.gem since /var/lib/gems/1.9.1 and /var/lib/gems/1.9.1/bin aren't both writable. WARNING: You don't have /hom...

how to update watir?

i am getting error while truing to install watir C:>gem install watir ERROR: http://rubygems.org/ does not appear to be a repository ERROR: Could not find a valid gem 'watir' (>= 0) in any repository C:>gem -v 1.3.7 C:>ruby -v ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] ...

Not sure what my problem is - seemingly getting gems installed on a prod server!

Hi all. I'm very new to rails and attempting to deploy some changes to my production server. In particular, I froze up my gems and have them all ready to go in my vendor/gems/ directory. I have also updated my config/environment.rb file to reflect the proper :lib and :source. When I try to push my content to my production server (via a S...

Why is bundler not installing gems stored in get repo properly?

Bundler version 1.0.0.beta.2 Rvm Info system: uname: "Linux dane-r1f-ubuntu 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:27:30 UTC 2010 i686 GNU/Linux" shell: "bash" version: "4.1.5(1)-release" rvm: type: "rvm is a function" version: "rvm 0.1.31 by Wayne E. Seguin ([email protected]) [h...

Could not find activerecord-jdbcmysql-adapter (existing is for Java)

I've been struggling with this problem for a few hours and it is preventing me from even starting my server, which therefore is stopping development completely. I am running Windows, Bitnami Rubystack, and that's pretty much it. I downloaded and installed NetBeans yesterday but my primary editor is Notepad++. I am not using JRuby. Here...

Installing ruby gems fails when attempting to build native

So I decided that I was going to give Ruby (first 1.9.1, then 1.8.7) a try and I wanted to get the basic tools installed before I attempted to do too much. I have begun to install some gems, and I have run into some issues when I attempt to install one which builds native code on windows 7. I was attempting to install the ruby debugge...

How to use RubyTorrent? (or other gems)

I was reading the book Ruby Cookbook by O'Reilly, and it has a section on RubyTorrent But if I do the following on Win 7: > gem install rubytorrent > irb irb(main):001:0> require 'rubytorrent' LoadError: no such file to load -- rubytorrent from (irb):6:in `require' from (irb):6 I looked and found that C:\Ruby\lib\ruby...