Solved

require 'icalendar' causes error

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
inactive users 13 70
How can I modify this Excel worksheet with a script? 15 73
copy-item script help 15 66
Creating 2 files from output with Powershell 5 37
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

930 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

13 Experts available now in Live!

Get 1:1 Help Now