Quantcast








     

Reading an XML file with Nokogiri in Rails 3

stackoverflow.com - 2013-02-25 14:02:33 - Similar - Report/Block

I have a problem trying to loop through part of an XML file. I'm using Nokogiri with Rails3. I'm reading this XML feed - http://www.ecb.europa.eu/stats/eurofxref /eurofxref-hist-90d.xml Here is my code: def save_rates # get the XML data form ECB URL file_handle = open('http://www.ecb.europa.eu/stats/eur ofxref/eurofxref-hist-90d.xml') #...

WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.7.3

stackoverflow.com - 2011-07-23 20:26:54 - Similar - Report/Block

I have done all kinds of research and tried many different things. I know this question has been answered many times, but none of the suggested solutions are working for me. After upgrading to lion I am getting segmentation faults in ruby. I'm fairly confident its nokogiri. So I installed libxml2 via homebrew. I ran 'brew link libxml2'. T...

Rails: Nokogiri issue, where to place code.

stackoverflow.com - 2012-04-26 03:34:08 - Similar - Report/Block

I have a question regarding applying Nokogiri into my Rails app. I'm trying to collect baseball stats from a website and display the data into the view. I'm successful in parsing the data, however, I am not sure where to store the code in a RESTful manner. Currently, I'm collecting the stats, putting them in an array and then matching the...

Rails fails to install

stackoverflow.com - 2012-04-29 23:28:44 - Similar - Report/Block

I'm trying to install rails on a Mac but am getting some strange errors: sudo gem install rails Successfully installed rails-3.2.3 1 gem installed Installing ri documentation for rails-3.2.3... file 'lib' not found Installing RDoc documentation for rails-3.2.3... file 'lib' not found rails --version Rails is not currently installed...

trying to get content inside cdata tags in xml file using nokogiri

stackoverflow.com - 2012-05-07 06:45:56 - Similar - Report/Block

I have seen several things on this, but nothing has seemed to work so far. I am parsing an xml via a url using nokogiri on rails 3 ruby 1.9.2. A snippet of the xml looks like this: <NewsLineText> <![CDATA[ Anna Kendrick is ''obsessed'' with 'Game of Thrones' and loves to cook, particularly creme brulee. ]]> </NewsLineTe...

Nokogiri to parse html

stackoverflow.com - 2012-06-10 07:50:45 - Similar - Report/Block

I am trying to use Nokogiri to parse the html in rails and get the Solution id "64455" and i am not sure how to feed my html <div class="container title-author"> <span class="solutions-title"> <a href="/cody_inside/problems/517-times-2- start-here/solutions/64455">Solution 64455</a> </span> I cant just use...

Insert XML from Nokogiri xml builder block into another using a method call

stackoverflow.com - 2012-04-06 04:35:55 - Similar - Report/Block

I'm trying to build xml for a library I'm making. What I'm trying to do is this: def block1 builder = Nokogiri::XML::Builder.new do |xml| xml.SomeStuff { xml.ThingsUnderStuff (block2 needs to go here) } end def block2 builder = Nokogiri::XML::Builder.new do |xml| xml.AddedToStuff {} end I'm not sure what to...

Trouble installing nokogiri with RVM 1.9.3 on Centos 6.2

stackoverflow.com - 2012-07-06 02:43:07 - Similar - Report/Block

/usr/local/rvm/rubies/ruby-1.9.3-p194/li b/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. I have installed ruby 1.9.3 using RVM on my CentOS 6.2 server. When I try to run gem install nokogiri it produces the the output below. I have alread...

How can I use Nokogiri to find specific text/words on a webpage?

stackoverflow.com - 2012-03-09 18:13:19 - Similar - Report/Block

I am new to nokogiri, but it looks like this would be the tool that I would use to scrape a webpage. I am looking for specific words on a webpage. The words are "Valid", "Requirements Met", and "Requirements Not". I am using watir to drive through the website. I currently have: page = Nokogiri::HTML.parse(browser.html) to get the html, bu...

Rails + processing.js - where to put .pde files?

stackoverflow.com - 2012-03-31 03:40:04 - Similar - Report/Block

I am using Rails 3.2 with asset pipeline. I am trying to add some processing.js to the app, the processing.js file is found fine, but the .pde file gives the error: Uncaught Processing.js: Unable to load pjs sketch files: graphBuilder.pde ==> Invalid XHR status 404 The folder structure is usual: RailsApp/app/assets/javascripts/pjs/grap ...

yml file exists but rails server and passenger complains that it doesn't

stackoverflow.com - 2012-08-07 22:26:27 - Similar - Report/Block

I've been following the railscast #85 by Ryan Bates at this link regarding YAML config files and I've ran into a problem that I can't find an answer to. I am using Ruby 1.9.3p194 through RVM and Rails 3.2.6. In my applications.rb, I have require 'yaml' APP_CONFIG = YAML.load_file("#{Rails.root}/config/con fig.yml")[Rails.env] I put the fo...

Get website headline with Nokogiri

stackoverflow.com - 2013-03-20 04:42:34 - Similar - Report/Block

I'm trying to get a website's headline (in Vietnamese) using Nokogiri: # encoding: utf-8 require 'rubygems' require 'nokogiri' require 'open-uri' page = Nokogiri::HTML(open("http://vnexpress.ne t")) list = page.css("a[class='link-topnews']") puts list[0].text but it's giving the error: undefined method `text' for nil:NilClass (NoMethodErr...

evolveStar Join

Rails 3 paperclip vs carrierwave vs dragonfly vs attachment_fu

stackoverflow.com - 2011-09-14 18:28:19 - Similar - Report/Block

I'm working on upgrading a Rails 2.3.11, Ruby 1.9.2 app to Rails 3.0.10, and attachment_fu no longer works. I'm looking at changing to paperclip, carrierwave, or dragonfly for file uploads, or maybe a Rails 3 compatible, maintained version of attachment_fu. Which of these options would be the best to use in terms of performance, how well...

Nokogiri 1.5.2 not installing on Ubuntu 11.10

stackoverflow.com - 2012-04-13 23:42:43 - Similar - Report/Block

Real quick, I am aware of a similar question . However, following the top rated answer does not work. I've already restarted my system and the terminal, but to no avail. For some reason, Nokogiri does not recognize that I have libxslt1-dev installed, though I explicitly installed it, both with sudo apt-get install libxslt-dev sudo apt-ge...

Rails URL Access

stackoverflow.com - 2012-07-10 18:01:59 - Similar - Report/Block

I'm new to Ruby on Rails, so please pardon my ignorance. My issue is that I cannot access the Rails project from the browser. I assume it has something to do with the Rails config, but I am having no luck so far. State of the Project I have existing logic (controllers, models, migrations, ...). If I leave index.html in place, I see the Ra...

Rails 3: Ruby 1.9.2: does it need /usr/bin/ruby1.8?

stackoverflow.com - 2010-12-16 20:19:28 - Similar - Report/Block

I am trying to get the Rails tutorial by Michael Hartl going. I spent a lot of time fighting various libraries. So I removed all ruby software from my Ubuntu 10.4 system. Then I installed Ruby 1.9.2. $ ruby -v ruby 1.9.2dev (2010-07-02) [i486-linux] So far so good. Then I did sudo gem install rails After a long time, it finished the i...

Nokogiri: How can you exlude HTML attributes with certain class names?

stackoverflow.com - 2012-03-02 19:44:08 - Similar - Report/Block

If I want to parse a html block using Nokogiri in Ruby like this: <th class="first">ancd</th> <th>xyz</th> <th>sdf</th> How do I exclude the tag containing a certain class name? the "first" in this case.

Rails/Memcached - MemCacheError (end of file reached): end of file reached

stackoverflow.com - 2012-04-04 21:38:58 - Similar - Report/Block

My Rails app is using a Memcached server. from some reason, from time to time, I'm getting MemCacheError (end of file reached): end of file reached in my Rails application logs. any ideas why?...

Understanding jQuery Rails Gem and rails.js

stackoverflow.com - 2012-03-22 10:09:19 - Similar - Report/Block

I'm trying to solve the book "Rails 3 in Action" where the authors have used the following code to add a link that uses ajax to generate a new file field. I'm having difficulty in understanding in how this works and what is the equivalent javascript(or jQuery) which can be functionally equivalent to understand it better: <%= link_to "...

Loading a file on an ISO 9660 File System

stackoverflow.com - 2012-03-16 04:14:20 - Similar - Report/Block

I just got done reading article on reading files on an ISO 9660 file system, and I am confused on how I would go about reading a file into memory. I understand that the root directory resides at offset 156, of the PVD, how would I use that to find a file that resides in the root directory, and once I find the file name, how would I find...

TinyMCE and ActiveAdmin for Rails

stackoverflow.com - 2012-05-02 04:35:43 - Similar - Report/Block

I am reacquainting myself with Rails and I am really liking Active Admin. I would like to get tinyMCE working with it for use in text areas. However, any instructions I find are incomplete. For some reason, I think that I am missing something really simple here. So, for example, I have tinymce-rails installed (3.4.9) and followed the inst...

Trying to upgrade to rails 3.1 getting the error: method_missing': undefined method `action_mailer

stackoverflow.com - 2012-03-08 03:26:14 - Similar - Report/Block

we have been using rails 3.0.9 for a long time, because of dependencies we now want to upgrade to the latest version. We set the gem file from: gem 'rails', '3.0.9' gem 'rake', '0.9.2.2' gem 'rails' gem 'rake' gem "actionmailer" And now when we try to run rails, get the following error: /Users/xxx/.rvm/gems/ruby-1.9.2-p180@and yw/gems/rail...

Comment on Twitter Bootstrap, Less, and Sass: Understanding Your Options for Rails 3.1 by R-on

rubysource.com - 2013-03-05 14:17:44 - Similar - Report/Block

Thank you very much for this great article. But the “Less-rails-bootstrap”-way did not work for me – Can anyone verify this? http://stackoverflow.com/questions/15222 455/rails-3-2-12-with-less-and-twitter-b ootstrap-v8-error Just another hint: Please modify the part “Bootstrap-sass and bootstrap-rails”. According with the documentation of t...

Rails upload form with carrierwave and polymorphic associations

stackoverflow.com - 2013-04-13 17:07:49 - Similar - Report/Block

I'm trying to wrap my head around using polymorphic associations to make file management less repetitive in a simple rails app. I'm using carrierwave to handle the file uploading. Here's what I have so far: app/uploaders/file_uploader.rb class FileUploader < CarrierWave::Uploader::Base def store_dir "uploads/#{model.class.to_s.underscor...

Rails Devise generate error

stackoverflow.com - 2012-06-10 07:35:32 - Similar - Report/Block

I'm fairly new to rails and I'm trying to set up devise and omniauth to allow users to login to my website with the Facebook API. I'm using this tutorial http://www.ruby-on-rails-outsourcing.com /articles/2012/01/20/adding-facebook-aut h-to-rails-3-1-app/ to do this. However, when I try to run rails generate devise User , I get this erro...

Gem not available in Rails app but works fine in Rails console (IMGKit)

stackoverflow.com - 2012-06-30 04:01:43 - Similar - Report/Block

Trying to create an IMGKit instance in one of my Rails controllers: def wkhtmltoimage ... kit = IMGKit.new("http://#{request.host_with_p ort}/?auth_token=" + token) img = kit.to_img(:jpg) file = kit.to_file(Rails.root + "public/uploads/testimage.jpg") ... When I load the page, I get this: NameError in PagesController#wkhtmltoimage uni...

Adding JQuery or Javascript code to a Rails 3.2 app?

stackoverflow.com - 2012-07-07 16:29:19 - Similar - Report/Block

I just finished Code School's intro course on JQuery, jQuery Air: First Flight . It was a great way to learn the basics of jQuery and when I was done I was all excited about adding some jQuery to my new little rails 3.2 app. How to make that happen isn't obvious, though. By default, rails 3.2 comes with the jquery-rails and coffee-rails...

Mac OSx Lion - Cannot get RoR installed

stackoverflow.com - 2012-06-16 06:19:19 - Similar - Report/Block

I recently upgraded to Lion and I am trying to install Rails. I used RubyGems to install rails and each time I tried to start a new rails project I would get an error saying, "Method 'list ' was not found". So I unistalled Rails using RubyGems. I noticed I had two versions installed. I uninstalled both. I then ran 'gem clean'. Once again...

Nokogiri builder performance on huge XML?

stackoverflow.com - 2012-03-16 03:35:43 - Similar - Report/Block

I have a problem with Nokogiri, i need to build a huge XML (about 1-50 MB). I thought that using builder would be effective enough and...well it is..somewhat. The problem is, that after the program reaches it's last line it doesn't end but Ruby process is still doing something (maybe Carbage collector?) for several seconds, after that pro...

Warble Custom war file name

stackoverflow.com - 2012-05-07 11:37:09 - Similar - Report/Block

I am using Wabler gem to generate the war file for our Ruby on Rails application. By default, it generates a WAR file named the Rails project home directory name by default. I would like to know if it is possible to specify custom war file name instead of the default project home directory name. Thanks Noman A.

Weird Ruby IO with Tempfile

stackoverflow.com - 2011-07-13 21:10:41 - Similar - Report/Block

This is driving me crazy. Consider the following: require 'open-uri' #set up tempfile extname = File.extname file_url basename = File.basename(file_url, extname) file = Tempfile.new([basename,extname]) #read form URI into tempfile uri = URI.parse(file_url) num_bytes_writen = file.write(uri.read) puts "Wrote #{num_bytes_writen} bytes" # Re...

Rails 3 jQuery UI Slider

stackoverflow.com - 2012-04-11 01:26:15 - Similar - Report/Block

I'm trying to use the jQuery UI Slider with my rails 3 app. I've downloaded a theme and put the css file in app/assets/stylesheet and I put all the images in app/assets/images. When I load a page with a slider, I get an error that it can't find an image: GET http://10.1.10.100:3000/assets/images/ui -bg_glass_45_0078ae_1x400.png 404 (Not Fo...

Devise 2.0.4, Rails 3.2.3 - After creating user account I am redirected to root and can't access other routes

stackoverflow.com - 2012-04-24 20:43:21 - Similar - Report/Block

I'm coming from Sinatra to Rails and still quite new to Rails. My problem is that after I create a User account I am just directed to the index.html page in the /public folder and can't seem to access any other routes, I can't sign_out the user and I can't add another user. I am using the devise gem to manage my user model and authenticat...

Ruby coder Pro needed. by bradleysnider

freelancer.co.uk - 2012-09-11 08:43:41 - Similar - Report/Block

Need help on scraping data into ruby on rails. Need to design existing PSD into Rails by real rails coder. Please if you do not work on rails dont pretend to. I need someone that is as good as me not someone... (Budget: $250-$750 USD, Jobs: AJAX, HTML, PHP, Ruby & Ruby on Rails)...

rails 3.1 Engines Gemspec and config initializers

stackoverflow.com - 2012-02-16 12:14:06 - Similar - Report/Block

I am developing an rails 3.1 mountable engine. Build the engine very well and mounted it on a sub-domain. Now what i am having issue is that, in my engine Gemfile i specified a gem: gem "show_for", "~> 0.2.4" also in .gemspec file s.add_dependency "show_for", "~> 0.2.4" then i used engine's script/rails g show_for:install and it...

Rendering an HTML file in rails

stackoverflow.com - 2013-03-04 07:41:53 - Similar - Report/Block

I am using CarrierWave to upload static HTML templates to certain user profiles on my webpage. I am trying to render the HTML file on the user's home page once they log in. The Path for the HTML file after uploading is: /uploads/profile/curation/8/User_Content .html I'm new to rails and I thought I'd just be able to <%= render /uploads/pro...

caches_page seems doesn't work properly in Rails 3?

stackoverflow.com - 2011-07-12 11:07:06 - Similar - Report/Block

I used caches_page in rails 3, everything went well, but I don't want those cache files spread in public directory by default, so I changed the default cache directory like this: config.action_controller.page_cache_dire ctory = Rails.public_path + "/caches" Yes, it still works, it writes cache file to public/caches directory, but it seem...

Система постоянно требует обновление - Ubuntu, Mint Linux

cyberforum.ru - 2013-02-07 03:10:44 - Similar - Report/Block

Система постоянно требует обновление и выдает ошиьку системы. Но после проведения обновления, обновление не устанавливается. Выдает ошибку: Кликните здесь для просмотра всего текста installArchives() failed: Selecting previously unselected package linux-image-3.2.0-37-generic. (Reading database ... (Reading database ... 5%% (Reading data...

Проблемы с установкой Rails - Ruby on Rails

cyberforum.ru - 2013-02-26 21:58:51 - Similar - Report/Block

Ubuntu 12.10 Код: $ ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux] $ gem install rails ERROR: Could not find a valid gem 'rails' (>= 0) in any repository ERROR: Possible alternatives: rails Что делать?...

Не могу развернуть на heroku - Ruby on Rails

cyberforum.ru - 2013-03-19 09:18:30 - Similar - Report/Block

После ~$ heroku login Выдает: /usr/lib/ruby/vendor_ruby/1.8/rubygems/d ependency.rb:247:in `to_specs': Could not find heroku (>= 0) amongst [abstract-1.0.0, actionmailer-3.0.9, actionpack-3.0.9, activemodel-3.0.9, activerecord-3.0.9, activeresource-3.0.9, activesupport-3.0.9, annotate-2.4.0, arel-2.0.10, builder-2.1.2, bundler-1.2.0, diff-...




dialogShowMessage!

Fill out the form you see below. Registration is free, fast and simple.
If you are already registered, sign in page login.


Web Site :
Required Field
First Name :
Required Field
Last Name :
Required Field
Email :
Required Field
Sex :
Required Field

evolveStar.com is free for ever !


evolveStar.com provides a search engine that allows you to gather information to write their own blog.


evolveStar.com enhances the sources displaying the logo of the site.


If you want to remove your site or you believe a site listed infringes copyright, please report it to: info@evolvestar.com


Specifies the subject copyright violation and the url of the page


evolveStar.com respecting the law DMCA (Digital Millennium Copyright Act) will immediately remove whatever its merits.


Next will be effectual and relevant checks.







Who We Are Partner Advertising Contacts Privacy terms Help & FAQ

© Copyright 2010-2017 Fabrizio Fichera. All rights reserved.