rubygems

require 'watir-webdriver' error

怎甘沉沦 提交于 2019-12-13 05:52:30
问题 I am trying to use Watir with Rails, and installed it, and when I use it from irb, it works fine. But when I try to include it in rails application, as require 'rubygems' require 'watir-webdriver' I get the following error: LoadError (no such file to load -- watir-webdriver) Some people had experienced the same problem, which was solved by using require 'rubygems', butin my case, the problem still persists. Any idea? 回答1: Did you add gem 'watir-webdriver' to your Gemfile in Rails root folder?

Active_Model error in rails

可紊 提交于 2019-12-13 05:49:34
问题 I went back to a rails project I was working on and the command "rails s" started to fail. The Terminal recommended that I run a bundle install. When I did I received the following message: Bundler could not find compatible versions for gem "activemodel": In Gemfile: protected_attributes (>= 0) ruby depends on activemodel (< 5.0, >= 4.0.0.beta) ruby rails (>= 0) ruby depends on activemodel (3.2.12) I have updated both ruby and rails. I've re-installed active model and restarted my terminal.

Rails cannot generate model using mysql

倾然丶 夕夏残阳落幕 提交于 2019-12-13 05:19:27
问题 Windows XP with installed MYSQL as a development machine, ruby 1.9.2p290 (2011-07-09) [i386-mingw32], Rails 3.1.0 gem install mysql2 -- '--with-mysql-lib="c:\Program Files\MySQL\MySQL S erver 5.5\lib" --with-mysql-include="c:\Program Files\MySQL\MySQL Server 5.5\inc lude"' (successfully installed gem mysql2) rails new talk -d mysql (successfully created a new rails app called talk) PROBLEM NOW STARTS: C:\Sites\RP\talk>rails generate User ERROR MESSAGE: ruby.exe-Unable to Locate Component This

Rails has many and belongs to

时光怂恿深爱的人放手 提交于 2019-12-13 05:05:21
问题 I am building a daily deal app to better learn Ruby on Rails. On M. Hartly tutorial, I understood the concept of models and their relationship (a microposts belongs_to a user, and a user has_many microposts). However I am not sure how to put that into practice on my daily deal project. I decided to have a Model for users with two type of users with different rights: admin_user who can create/update/edit/delete the deals standard_user who can see the deals and if they find one interesting

RubyGem Native Extension - can't find ntohl() in -lsocket

喜你入骨 提交于 2019-12-13 04:58:38
问题 Here's a question where Google hasn't been very helpful thus far: I'm installing a RubyGem on Linux Mint that uses native extension, so it's trying to compile them on my machine. As often happens, it returns an error stating that it doesn't have all the tools on the machine necessary to build the extension: Building native extensions. This could take a while... ERROR: Error installing sas-helper: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb checking for expat.h..

Rubygems: specify dependency on the latest version of a gem

倾然丶 夕夏残阳落幕 提交于 2019-12-13 04:47:48
问题 I'm developing a gem A that depends on another gem B. I need the user of my gem to have the latest version of B whatever it is. So I would like to say in my gemspec something like spec.add_dependency "B", :latest The reason for this is that B contains a database driver that needs to be in its latest version otherwise the database rejects the connection. So in other words I need to force gem update before my gem is used. Is there a way how to do this in gemspec? I know I can specify the

private method `split' called for nil:NilClass (NoMethodError)

佐手、 提交于 2019-12-13 04:13:17
问题 I'm trying to use domainatrix with nokogiri and am coming up with a holdup. Being relatively new to ruby, I've tried every syntax variation on the Domainatrix.parse function I can to get the a href's to parse properly. They do print during the "puts" command but when I uncomment the domainatrix code problems start: require 'rubygems' require 'domainatrix' require 'anemone' require 'open-uri' require 'nokogiri' doc = Nokogiri::HTML(open("http://www.cnn.com")) doc.xpath('//a/@href').each do

In Ruby on Rails, after “gem install <gem_name>”, how to make it extend Array, or use its class method?

江枫思渺然 提交于 2019-12-13 04:13:08
问题 Summary: after I gem install <gem_name> , how do I make it extend Array which the gem can do? Details: I see a gem for "natural language sort", which is http://rubygems.org/gems/naturalsort http://naturalsort.rubyforge.org/ so I am using Ruby 1.9.2 and Rails 3.0.6, and I add the line gem 'naturalsort' into Gemfile , and do a bundle install and restart the server, but now, for some reason, I still can't do a NaturalSort::naturalsort ['a', 'b', 'c', 'd', 'A', 'B', 'C', 'D'] in my helper file?

Getting gcal4ruby gem to work

99封情书 提交于 2019-12-13 03:47:02
问题 I'm trying to create a RoR web application that allows people to connect to their accounts to google calendar. I found a gem called gcal4ruby that seemed to do the right things based on looking at sample code and its documentation. I ran gem install and the cmd claimed the installation was ok. However, when I added the gem to my gemfile then try to run the server again I get: Could not find 'gcal4ruby (= 0.0.5, runtime)' in any of the gem sources Try running 'bundle install'. Then I tried

ruby loaderror inotify

删除回忆录丶 提交于 2019-12-13 03:39:39
问题 I am working from a Linux machine - I get the following error from irb when I type require 'inotify'. Appreciate any help/pointers. irb(main):001:0> require 'inotify' LoadError: no such file to load -- inotify from :29:in require' from <internal:lib/rubygems/custom_require>:29:in require' from (irb):1 from /usr/bin/irb:12:in `' irb(main):002:0> Gem.path => ["/home/johnq/.gem/ruby/1.9.1", "/usr/lib/ruby/gems/1.9.1"] irb(main):003:0> johnq$ gem list *** LOCAL GEMS *** abstract (1.0.0)