rubygems

How to rescue from a reqiure "gem_name" when the gem is not installed

I'm writing a library that depend on a specific gem. I require the gem and use it in my code and everything is hunky-dory as long as the gem is installed on the user's machine. but what if it is not?! I thought it's fine cause I can rescue from the require command and print a message to the output to inform the user about the lacking ge...

No gem called "activerecord-sqlite3-ruby-adapter"

I am trying to set up active records on top of a sqlite3 database with native ruby 1.8. This should work easily enough, I have seen plenty of examples out there that explain how. I am using some example code I have found, its pretty basic and starts with the following lines: require 'rubygems' require 'active_record' #require 'sqlite3-r...

Building a ruby gem for Rails applications

As a Rails developer I feel a bit stupid asking this question but hopefully I will learn something new and someone can put me out of my misery! In my rails applications I use (other peoples) gems all the time, I also use plugins from the community or my own. I understand the benefits of use gems over plugins as they are version-able, se...

Errors installing some gems on Snow Leopard - libxml2

After upgrading to Snow Leopard, I found that installing some gems no longer worked, including webrat, mechanize etc. Each time I get this error: checking for xmlParseDoc() in -lxml2... no libxml2 is missing. try 'port install libxml2' or 'yum install libxml2' *** extconf.rb failed *** Could not create Makefile due to some reason, pro...

Ruby Gems on Windows

I have removed and reinstalled ruby on my machine (windows 7, ruby 1.9.1). When I go to get rails again I get: While executing gem... File Exists C: Yet when I list my gems is says none are installed. What gives? ...

MissingSourceFile when I run "cucumber features"

I had cucumber 0.6.1 working quite fine... but I ran the gem update cucumber command, and things went smoothly. Then when I decided to run the cucumber features command, I received this error: Using the default profile... no such file to load -- cucumber/webrat/element_locator (MissingSourceFile) /usr/local/lib/ruby/site_ruby/1.8/rubyg...

How to search for useful ruby gems

What are good sites to look for useful ruby gems? ...

Proper way of testing gems

If a gem has rails dependencies, do you think it is better to write the gem tests in a way they can be run standalone or run them under a rails project? ...

How to add gem dependencies that host on other site in a gemspec file?

In a gemspec file, is there a way to add dependency gem that hosts on other sites like github? I build a gem that has a dependency to http://github.com/mbleigh/mash. I checked the method add_dependency, but it seems it doesn't have that functionality. Could anyone show me how to do this? ...

problems installing thin on Windows

Hi all, I'm trying to install Thin on Windows (ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]) but get an error message: C:>gem install thin Building native extensions. This could take a while... ERROR: Error installing thin: ERROR: Failed to build gem native extension. C:/rails/ruby/bin/ruby.exe extcon...

any html/css parsing library for ruby & PHP?

I am about to finish my script that parses/scrapes website using mechanize&ruby. I need to port my script to PHP in the future. My question is if there is any library available for both ruby and php or if anybody can recommend any other approach to this? ...

'sudo gem install' or 'gem install' and gem locations

running 'sudo gem list --local' and 'gem list --local' gives me differing results, my gem path is set to my home folder and only contain the gems from 'gem list --local'. So it's probably not good to have gems installed in different directories on my computer, should I have the gem path set differently? and should I always use sudo when...

Rails optional gem config

What do you do when you want to use a gem for development/testing that you don't want to force other devs to use? Right now I have begin require 'redgreen' rescue LoadError end in test_helper.rb and no gem config, but that seems like a clumsy approach, albeit a functional one. I'd like to do something like the following: config....

Can't upload photo using paper clip in RoR

I use this code to upload photos, I find that it is not successfully upload photo, but other content can be updated. <% semantic_remote_form_for(@product, :html => {:multipart => true}) do |f| %> <% f.inputs do %> <%= f.input :title, :label => "Name" %> <%= f.input :category , :include_blank => false , :label => "Catego...

complicated installation spagetti of latest Rails 2.3.5

Hi, the basic and, I guess, more rhetorical question is why RoR installation/maintenance became so F%#$ing complicated? Some background of the problem: Platform: Windows XP Ruby version: 1.8.6 A few dozens gems installed with gem version 1.2.0 Current Rails version: 2.1 I just wanted to update to rails 2.3.5 thinking that I have a mode...

Is there any command to check what plugins I am using in my RoR application?

Can I use any command to check if my application is using any plugins or not? ...

Phusion Passenger on Ubuntu 8.10: how to setup gem directory and users?

I am actually running phusion passenger on ubuntu for a while. today i updated Ruby Enterprise Edition to the latest version - now it seems i have to reinstall all the gems that were installed on the system. so here are my questions what is the best way to setup phusion passenger and ruby enterprise edition to easily maintain gems afte...

chronic gives me error after installation (ruby)

I run ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] I had to upgrade RubyGems so I run 1.3.5 now then I istalled chronic (0.2.3) but I only receive ./chronic.rb:3: uninitialized constant Chronic (NameError) from E:/prog/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from E:/prog/r...

hoptoad_notified gem won't unpack into vendor

I think this should be working. environment.rb config.gem "hoptoad_notifer", :version => '=2.1.2' list of installed gems: $ gem list hoptoad_notifier *** LOCAL GEMS *** hoptoad_notifier (2.1.2) Output of rake:gems $ rake gems (in /rails/appdir) - [R] hoptoad_notifier = 2.1.2 I = Installed F = Frozen R = Framework (loaded befo...

What is the best Installation Guide for installing Rails on Ubuntu 9.10?

I have a clean install of Ubuntu 9.10. I want to install Ruby 1.8, RubyGems and Rails. The install usually fails when trying to get or update RubyGems. Sorry for the lack of details, I have gotten stuck on a number of fronts. What is the best, guaranteed to work, installation guide\blog post\tutorial for installing Ruby, RubyGems and Ra...