Muthu Selvan
2013-Jun-18 23:17 UTC
`require'': cannot load such file -- nokogiri (LoadError) in rubyXL
Hi All Getting the below error when running the source code My requirement is : I want read / write the excel sheet ( both xls / xlsx ) from Ruby , if you have any other solution also share with me .. *Source Code :* * * * bash-3.2$ cat rubyXL.rb require ''rubyXL'' workbook = RubyXL::Parser.parse("test.xlsx") workbook = RubyXL::Workbook.new sheet_Name = workbook.worksheets[0] puts sheet_Name * * * *ERROR* rubyXL.rb /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in *`require'': cannot load such file -- nokogiri (LoadError)* from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'' from /Users/mselv2/.rvm/gems/ruby-1.8.7-p371/gems/rubyXL-1.2.10/lib/rubyXL/writer/content_types_writer.rb:6:in `<top (required)>'' from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'' from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'' from /Users/mselv2/.rvm/gems/ruby-1.8.7-p371/gems/rubyXL-1.2.10/lib/rubyXL/workbook.rb:1:in `<top (required)>'' from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'' from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'' from /Users/mselv2/.rvm/gems/ruby-1.8.7-p371/gems/rubyXL-1.2.10/lib/rubyXL.rb:2:in `<top (required)>'' from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'' from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'' from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'' from rubyXL.rb:1:in `<main>'' *Installed rubyXL also :* * * *bash-3.2$ gem list | grep "XL"* *rubyXL (1.2.10)* Thanks , Muthu Selvan SR -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/caabde04-cb61-4ae0-9781-2f8a0afc8af5%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Walter Lee Davis
2013-Jun-19 01:10 UTC
Re: `require'': cannot load such file -- nokogiri (LoadError) in rubyXL
On Jun 18, 2013, at 7:17 PM, Muthu Selvan wrote:> Hi All > > > Getting the below error when running the source code > > My requirement is : I want read / write the excel sheet ( both xls / xlsx ) from Ruby , if you have any other solution also share with me .. > > Source Code : > > bash-3.2$ cat rubyXL.rb > require ''rubyXL'' > workbook = RubyXL::Parser.parse("test.xlsx") > workbook = RubyXL::Workbook.new > sheet_Name = workbook.worksheets[0] > puts sheet_Name > >Try adding require statements for rubygems and nokogiri. It seems like something in there is depending on Noko, which isn''t surprising, since it''s the Swiss army bulldozer of XML. Walter> > > ERROR > rubyXL.rb > /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'': cannot load such file -- nokogiri (LoadError) > from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'' > from /Users/mselv2/.rvm/gems/ruby-1.8.7-p371/gems/rubyXL-1.2.10/lib/rubyXL/writer/content_types_writer.rb:6:in `<top (required)>'' > from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'' > from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'' > from /Users/mselv2/.rvm/gems/ruby-1.8.7-p371/gems/rubyXL-1.2.10/lib/rubyXL/workbook.rb:1:in `<top (required)>'' > from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'' > from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'' > from /Users/mselv2/.rvm/gems/ruby-1.8.7-p371/gems/rubyXL-1.2.10/lib/rubyXL.rb:2:in `<top (required)>'' > from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'' > from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'' > from /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'' > from rubyXL.rb:1:in `<main>'' > > Installed rubyXL also : > > bash-3.2$ gem list | grep "XL" > rubyXL (1.2.10) > > Thanks , > Muthu Selvan SR > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/caabde04-cb61-4ae0-9781-2f8a0afc8af5%40googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0A2908D6-D6E9-4035-9CC4-83DCB55FF256%40wdstudio.com. For more options, visit https://groups.google.com/groups/opt_out.
Tamara Temple
2013-Jun-22 19:34 UTC
Re: `require'': cannot load such file -- nokogiri (LoadError) in rubyXL
Muthu Selvan <pearl.selvan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> My requirement is : I want read / write the excel sheet ( both xls / xlsx ) from Ruby , if you have any other solution also share with me ..You may want to ask on the ruby list instead of the rubyonrails list...> Source Code : > > bash-3.2$ cat rubyXL.rb > require ''rubyXL'' > workbook = RubyXL::Parser.parse("test.xlsx") > workbook = RubyXL::Workbook.new > sheet_Name = workbook.worksheets[0] > puts sheet_Name > > ERROR > rubyXL.rb > /usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'': cannot load such file -- nokogiri (LoadError)Silly question: did you install nokogiri? That message above tells you just what it cannot find.> Installed rubyXL also : > > bash-3.2$ gem list | grep "XL" > rubyXL (1.2.10)Now try: gem list | grep nokogiri In looking at the rubyXL gem, the gemspec file does list nokogiri and a few other things as run-time dependencies, but I don''t quite understand the syntax used in the .gemspec -- it *looks* like it should pull them in, but neither gem install nor bundle install (if rubyXL is placed in a Gemfile) are getting included. If you look inside the rubyXL.gemspec file where rubyXL was installed, you can find the other things it depends on and install those as well.> Thanks , > Muthu Selvan SR-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/51c5fc35.4943320a.5916.ffffddfb%40mx.google.com. For more options, visit https://groups.google.com/groups/opt_out.
Apparently Analagous Threads
- [HELP] BUILD FAILED while Installing ruby-1.8.7-p371 in mac OS...
- Problem when using bundle exec rake with Launchd
- What it exactly do these do ( RubyXL::Parser.parse and Roo::Excelx.new) when opening a file?
- Best library for reading/wriiting excel in ruby
- Issue with Deploying a Rails app on VPS - cannot load such file -- unicorn/launcher