gem

How to uninstall all ruby gems on windows?

こ雲淡風輕ζ 提交于 2019-12-20 08:59:36
问题 How to uninstall all ruby gems on Windows? Is it possible with single command? 回答1: One line to rule them all. Power shell not needed. From command prompt run: ruby -e "`gem list`.split(/$/).each { |line| puts `gem uninstall -Iax #{line.split(' ')[0]}` unless line.empty? }" Just copy / paste and voila! 回答2: I've found an elegant solution gem list | %{$_.split(' ')[0]} | %{gem uninstall -Iax $_ } and Windows Powershell 回答3: You can delete the contents of your gems folder. Where this is will

Writing a Ruby extension in Go (golang)

旧巷老猫 提交于 2019-12-20 08:26:15
问题 Are there some tutorials or practical lessons on how to write an extension for Ruby in Go? 回答1: Go 1.5 added support for building shared libraries that are callable from C (and thus from Ruby via FFI). This makes the process easier than in pre-1.5 releases (when it was necessary to write the C glue layer), and the Go runtime is now usable, making this actually useful in real life (goroutines and memory allocations were not possible before, as they require the Go runtime, which was not useable

How to use 'debugger' and 'pry' when developing a gem? (Ruby)

筅森魡賤 提交于 2019-12-20 05:28:16
问题 I'm developing a gem, and my Gemfile looks like this: source :rubygems gemspec group :development, :test do gem "pry" gem "debugger" gem "rake" end However, I don't want people to have to install pry and debugger when running tests, but I also want to be able to require them in my tests (because I'm running tests prefixed with bundle exec , and I cannot get it them in my load path if they're not in the Gemfile). How do I achieve this? Also, when to put gems that I use for development in the

Rake tasks inside gem not being found

久未见 提交于 2019-12-20 04:56:41
问题 I have implemented what edebill suggested in his answer to this question. If I point to the gem in the usual way, with it installed in my environment gem 'activerecord_datawarehouse' rake -T does not show my rake tasks, but if I point directly to the gem source code, like gem 'activerecord_datawarehouse', :path => "/home/acras/code/activerecord_datawarehouse" It shows and rake tasks work perfectly. What could I be missing here? I did double checked and the installed gem is the same that I

How do I install 'byebug' for ruby on Windows?

北战南征 提交于 2019-12-20 04:55:37
问题 I am new to ruby and trying to setup my dev environment (Windows 10). I have installed ruby and rails but cannot install byebug. From what I read I need the DevKit first. So I installed it by following the guide here: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit and then tried to install the gem but have no luck. I have tried to uninstall and then force install DevKit but still cant get byebug installed. This is what I am seeing: C:\RubySDK>gem install byebug Temporarily

Ruby on Windows7 - could not find gem

独自空忆成欢 提交于 2019-12-20 04:00:06
问题 I'm setting up a ruby Apache Buildr on a fresh Windows 7 machine. I've installed Ruby, the DevKit and installed buildr via gem install buildr wich all ran perfect. Until I tried to execute buildr, then I get an error. buildr compile C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find buildr (>= 0) amongst [atoulme-Antwrap-0.7.1, builder-2.1.2, buildr-1.4.5-x86-mswin32, buildr-as3-0.2.12, diff-lcs-1.1.2,highline-1.5.1, hoe-2.3.3, json_pure-1.4.3,

rails 4 use application helpers inside initializers

孤者浪人 提交于 2019-12-20 03:11:32
问题 Is it possible to include / use Application Helper methods inside of an config/initializers/browser_blocker.rb ? I am using the browser gem to detect and block older non modern browsers. Rails.configuration.middleware.use Browser::Middleware do include ApplicationHelper redirect_to :controller => 'error', :action => 'browser-upgrade-required' if browser_is_not_supported end Helper method I am currently working with: # test browser version def browser_is_not_supported return true unless

Ruby autoload conflicts between gmail and parse_resource gems

你说的曾经没有我的故事 提交于 2019-12-20 02:54:56
问题 Earlier, I asked about autoload in the gmail gem not being able to find the files it wanted to load. In building a minimal script, I found the gmail gem loaded it's files when I didn't include the parse_resource gem. The gmail gem lets you access your emails, labels, and inboxes from gmail. The parse_resource gem wraps the parse.com api in an ActiveRecord pattern. If I include the parse_resource gem before the gmail gem, ruby throws a LoadError. These are the permutations of the minimal

Override a method inside a gem from another gem

佐手、 提交于 2019-12-20 02:11:32
问题 Ok, I have a rails gem that I am working on and I want it to override a specific method in sprockets. The method I want to override is: Sprockets::Base.digest so that I can base the fingerprint off my gem version when compiling the app's assets. How would I go about doing that? In my gem I create a file lib/sprockets/base.rb and place the following code: class Sprockets::Base def digest @digest = digest_class.new.update(MyGem::VERSION) @digest.dup end end When I run bundle exec rake assets

Override a method inside a gem from another gem

故事扮演 提交于 2019-12-20 02:11:08
问题 Ok, I have a rails gem that I am working on and I want it to override a specific method in sprockets. The method I want to override is: Sprockets::Base.digest so that I can base the fingerprint off my gem version when compiling the app's assets. How would I go about doing that? In my gem I create a file lib/sprockets/base.rb and place the following code: class Sprockets::Base def digest @digest = digest_class.new.update(MyGem::VERSION) @digest.dup end end When I run bundle exec rake assets