Solved

require 'icalendar' causes error

Posted on 2013-01-07
1
462 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
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to count occurrences of each item in an array.

747 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now