Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

require 'icalendar' causes error

Posted on 2013-01-07
1
Medium Priority
?
507 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 2000 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

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

927 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