rubygems

WebMock: Rspec - Test Facebook Validation by using JSON response

落爺英雄遲暮 提交于 2019-12-23 13:24:39
问题 I am having difficulty to write specs for my program as I need to validate the facebook ID after I filled in all the correct format information. My facebook ID is retrieved from JSON response so I not sure how do I portray this in my specs. I am very new to this field and I had been stuck at this point for a long time. I will be grateful if there are some sample codes to help me in this. Below are my half-done specs. Scenario: Use user given Fbid to validate facebook page by using "http:/

nested_form gem add works but remove fails…why?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 12:42:28
问题 I'm using the madebydna version of Ryan Bates' nested_form gem from GitHub (can be found at https://github.com/madebydna/nested_form). I'm using the forked version for jQuery support as opposed to Prototype. UPDATE: Check the bottom of the page for an update to this question. EDIT: I'm using: RoR v3.0.5, jQuery v1.4.3, Ruby v1.9.2 END EDIT EDIT: It appears the current structure of the pictures_attributes parameter passed along to the server is causing an issue, at least from what I've seen on

gem install memcached fails

你说的曾经没有我的故事 提交于 2019-12-23 12:34:14
问题 On doing gem install memcached following error gets thrown. .... .... checking for pod2man... /usr/bin/pod2man ./configure: line 22468: syntax error near unexpected token `sasl,,' ./configure: line 22468: ` AC_LIB_HAVE_LINKFLAGS(sasl,,' make: *** [config.status] Error 2 *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. I have already install

Upgrade to Lion, failed to build gem native extensions

◇◆丶佛笑我妖孽 提交于 2019-12-23 12:13:37
问题 Not sure if my problem is related to this thread (http://stackoverflow.com/questions/6589066/rmagick-and-os-x-lion), but I just upgraded to Lion; more specifically I purchased an new machine and migrated over my old profile. I am unable to launch rails 3 because it cannot find rmagick, and I am unable to install rmagick, because I get the following error. I tried uninstalling rmagick and imageMagick, but I still get the same error when attempting to bundle install. Any thoughts? Thank you

Error installing mysql2 gem: Failed to build gem native extension

廉价感情. 提交于 2019-12-23 12:00:07
问题 Windows XP. Ruby 1.9.2. Rails installed. MySQL installed. When I try to run gem install mysql2 (or bundle install ) I get errors: C:\ruby\cred2>gem install mysql2 Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. C:/Ruby192/bin/ruby.exe extconf.rb checking for rb_thread_blocking_region()... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers

Why use a nested Ruby module for version information?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 11:25:31
问题 I've been looking at the source code of a few gems lately. One idiom that I keep seeing is the use of a nested module containing version constants that are joined into a version string i.e. variations around this sort of thing: module ChunkyBacon module Version MAJOR = 0 MINOR = 6 TINY = 2 end VERSION = [Version::MAJOR, Version::MINOR, Version::TINY].compact * '.' end What's the advantage (if any) of storing the library version information in this way? Why not just do: module ChunkyBacon

Possible to change gem sources for chef-client?

孤街浪徒 提交于 2019-12-23 11:00:15
问题 Is any one aware of a way to change the gem sources for a chef-client run? My node of concern is behind a firewall, so I want to replace rubygems.org with an internal Nexus repo (https://github.com/sonatype/nexus-ruby-support). I tried updating the source list for 'chef embedded gem', but the offending chef_gem calls seem to be using a different source list that still refers to rubygems.org. 回答1: You can override the source URLs in /root/.gemrc The format is as follows: :sources: - http:/

Error when trying to generate devise:install in Ruby on Rails

十年热恋 提交于 2019-12-23 10:06:06
问题 I'm a new to Ruby on Rails and I tried to do some examples from Internet. But I have an error when I'm trying to generate devise install. I modified the Gemfile by adding gem devise . Then run: bundle install but when I run. rails generate devise:install I had the next error: /usr/local/lib/ruby/gems/0.9.1/gems/devise-1.1.3/lib/devise.rb:193:in `mailer=': undefined method `ref' for ActiveSupport::Dependencies:Module (NoMethodError) from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.1.3/lib

Gem loads in irb but not console

我们两清 提交于 2019-12-23 09:15:38
问题 This one is driving me nuts. I can load a gem via irb: steve@server:/var/www/listings$ irb irb(main):001:0> Gem.path => ["/home/steve/.gem/ruby/1.9.1", "/usr/local/ruby/lib/ruby/gems/1.9.1"] irb(main):002:0> require 'nokogiri' => true But I can't load it through the rails console: irb(main):001:0> Gem.path => ["/home/steve/.gem/ruby/1.9.1", "/usr/local/ruby/lib/ruby/gems/1.9.1"] irb(main):002:0> require 'nokogiri' => false The gem (nokogiri) is installed steve@server:/var/www/listings$ gem

Does Capistrano need to be in the development group in the Gemfile?

試著忘記壹切 提交于 2019-12-23 09:08:01
问题 In a rails Gemfile, does gem 'capistrano' need to be inside the :development group or this there any advantage in putting it inside an arbitrary group like :tools ? 回答1: Simply put, no, it doesn't need to be, but it's good for the sake of best practices and keeping your gemsets uncluttered. The best way to do that is open for debate, but basically as long as Capistrano is available to you in the environment you're working in, it doesn't matter what groups it is or isn't associated with,