Solved

require 'icalendar' causes error

Posted on 2013-01-07
1
485 Views
Last Modified: 2013-01-11
Hello,

I'm relatively new to Ruby-on-Rails.

I need to use an Icalendar event in my web app.

First, I installed the icalendar gem like so:

gem install icalendar

I then run the gem list command, and it indicates the gem is installed.

However, I can't actually use the gem anywhere.  if I do something like

event = Icalendar::Event.new

I get the error that Icalendar is an unintialized constant.

If I try to include icalendar within a class like so...

require 'icalendar'

I get the error

MissingSourceFile:  no such file to load -- icalendar

any suggestions?

Thanks in advance,
Tim
0
Comment
Question by:tmitch68
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 24

Accepted Solution

by:
fridom earned 500 total points
ID: 38766051
I tried to reproduce your problem but failes. I did the following:
rvm install 1.9.3 (to install the actual MRI)
then I run
sudo gem install icalendar
after that I started irb
requrired 'icalendar'
and types in your command:
Here's the output:
sudo gem install icalendar
[sudo] password for frido: 
Fetching: icalendar-1.2.1.gem (100%)
PostInstall.txt
Successfully installed icalendar-1.2.1
1 gem installed
Installing ri documentation for icalendar-1.2.1...
Installing RDoc documentation for icalendar-1.2.1...
~% irb
1.9.3p125 :001 > require 'icalendar'
 => true 

1.9.3p125 :003 > event = Icalendar::Event.new
 => #<Icalendar::Event:0x00000000eabd48 @name="VEVENT", @components={}, @properties={"sequence"=>0, "dtstamp"=>#<DateTime: 2013-01-11T07:35:21+01:00 ((2456304j,23721s,614212958n),+3600s,2299161j)>, "uid"=>"2013-01-11T07:35:21+01:00_386670668@fxen"}> 
1.9.3p125 :004 > 

Open in new window



I would assume that something is wrong with either your ruby installation
or the gem installation.

Maybe you should use the rvm collection?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question