gem

Error when installing nokogiri on mac with“sudo gem install nokogiri”

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 21:35:31
问题 I was trying to install nokogiri because it is required for rails to be started $ rails s /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find nokogiri-1.5.5 in any of the sources (Bundler::GemNotFound) from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `map!' from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `materialize'

Developing helper functions that generate HTML: should I rather use nested content_tag()s or partials?

爷,独闯天下 提交于 2019-12-10 21:25:37
问题 I'm at the start of developing a Rails engine (and gem) that should provide many small helper functions that generate HTML for views. Now I wonder whether it's advisable to rely on the use of many nested content_tag calls to generate the HTML, or if it's more pragmatic to just rely on partials. In my opinion, the first approach may be a bit cleaner (but slower in performance), but the 2nd approach seems much easier to do, so I guess I will favor the 2nd one. What do you guys think? 回答1: many

Can't activate rack (~> 1.4.0, runtime) already activated rack-1.5.0

随声附和 提交于 2019-12-10 21:16:13
问题 I've been looking for an answer to this for over a day now, and searched StackOverflow thoroughly. I understand the conflict that's happening, and I should just uninstall the version of Rack I don't need, but here's the thing. I'm developing on Koding (http://koding.com) and I don't have access to system level gems. Rails was working before, I installed the mongo gem, removed it, and installed mysql2 gem. bash4.1$ rails /usr/lib/ruby/site_ruby/1.8/rubygems.rb:233:in `activate': can't activate

Modifying core classes in a gem

若如初见. 提交于 2019-12-10 21:10:06
问题 I'm developing a Gem which I think will be useful for more people than just me. One issue I'm facing is that I need to merge nested hashes. I found this useful Gist to accomplish that, but now I'm wondering if it's okay to modify Hash# like this in a Gem? I'm sure there's a community "standard" or best practices that either accepts or declines this sort of code, so I'm turning to SO for guidance. Thank you. 回答1: When in doubt, just subclass Hash and include the Module in your subclass. You

seeing different gem lists in cygwin and powershell

狂风中的少年 提交于 2019-12-10 21:06:30
问题 I used the gem list command in powershell and cygwin and both show different gem lists. Cygwin shows *** LOCAL GEMS *** bundler (1.2.3) json (1.7.5) minitest (2.12.1) rake (0.9.2.2) rdoc (3.12) while in powershell I see : *** LOCAL GEMS *** io-console (0.3) json (1.5.4) minitest (2.5.1) rake (0.9.2.2) rdoc (3.9.4) sass (3.2.1) So, the versions of same gem are also different in two. Why is it so? Also, I was getting problems with bundle install while using rails(int both Cygwin and Powershell)

ruby 2.0.0 bundle fails with 'key: value' on Gemfile

こ雲淡風輕ζ 提交于 2019-12-10 19:48:34
问题 I'm trying to update my gems using a Gemfile but always fails in the same line: Gemfile: group :doc do gem 'sdoc', require: false end Command: $ bundle update I'm always getting this error: Gemfile syntax error: /Users/GrzegorzFeathers/Documents/Edx/SaaS/rottenpotatoes/Gemfile:32: syntax error, unexpected ':', expecting kEND gem 'sdoc', require: false When I change that line syntax to this, the problem was solved: gem 'sdoc', :require => false But why can't I use the other one?, I checked my

Ruby: Rails: Which version of a gem is used?

荒凉一梦 提交于 2019-12-10 19:10:04
问题 I have a Rails 3 application which has the following line in the Gemfile. gem 'sqlite3', '1.3.6' However, if I list my local gems I get: > gem list sqlite3 --local *** LOCAL GEMS *** sqlite3 (1.3.6, 1.3.4) When my Rails apps does a require 'sqlite3' which version of the gem is selected? Is it that the first gem in the list is selected? Is there a way to tell the Ruby runtime to use version 1.3.4 even if version 1.3.6 is installed, and mandated by the Gemfile? 回答1: You could find out with

rails/heroku migrating from gem to toolbelt

こ雲淡風輕ζ 提交于 2019-12-10 19:07:41
问题 I used to use the heroku gem with a project. Now that the toolbelt is out, I wanted to switch. I removed the gem from the Gemfile and I uninstalled it via gem uninstall heroku. I installed the heroku toolbelt with the pkg from heroku's website. Now, everywhere on my system it seems that the new toolbelt is available when I do e.g. heroku version But inside that one directory where I store my Rails Project, I get an error as it is still looking for the old heroku gem (that has now been

How to execute Ruby program with locally installed gems?

六月ゝ 毕业季﹏ 提交于 2019-12-10 19:00:54
问题 I have installed my dependencies using bundle package Then transferred them to the offline server and running: > bundle install --local Using mime-types (1.19) Using rest-client (1.6.7) Using trollop (1.16.2) Using bundler (1.1.4) Your bundle is complete! It was installed into ./vendor/bundle However, it is not possible to run the application: ruby someprogram.rb /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- trollop (LoadError) from /usr/local

Nokogiri native extension failing to build (Not libxml2 or libxslt missing issue)

烈酒焚心 提交于 2019-12-10 18:51:22
问题 As the title says, it doesn't seem to be failing because libxml2 or libxslt is missing. I'm not really sure what to make of the error. (Get it? Because the issue is during make? hehe...) Anywho, here's the output I'm getting. Any ideas would be appreciated: Building native extensions. This could take a while... ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.