rubygems

Error installing gems that use native extensions on Ubuntu, Ruby 1.9.2 via RVM

余生颓废 提交于 2019-12-18 10:55:18
问题 I get an error while trying to install the ffi gem: ~ - 16:54>gem i ffi Building native extensions. This could take a while... ERROR: Error installing ffi: ERROR: Failed to build gem native extension. rake RUBYARCHDIR=/home/mdemare/.rvm/gems/ruby-1.9.2-p136/gems/ffi-1.0.6/lib RUBYLIBDIR=/home/mdemare/.rvm/gems/ruby-1.9.2-p136/gems/ffi-1.0.6/lib /home/mdemare/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems.rb:370:in `bin_path': can't find gem rake ([">= 0"]) with executable rake

Is there any way to tell which gems and plugins are loaded at runtime for a Rails process?

二次信任 提交于 2019-12-18 10:35:51
问题 Is there any command either in debugger or ruby-debug to get a list of all gems and/or plugins loaded in memory for a Rails process? I understand only the ' require ' gems are loaded but I would like to quickly see what got loaded during runtime. 回答1: This should get you everything loaded through rubygems: Gem.loaded_specs.keys I don't know of a universal way to see which rails plugins are loaded, you can look at the source for Rails::Initializer (pre 3.0) & figure out what your version of

Use Rails 3's ActiveSupport core extensions outside rails

安稳与你 提交于 2019-12-18 10:26:36
问题 I'm having a problem using ActiveSupport's core extensions on a gem I am developing. I had it working with AS 2.3.8, but as soon as I wanted to port it to 3b4, the extensions stopped working and my test results are filled with lines such as: undefined method `blank?' for "something":String I've included it via gem "activesupport" followed by require "active_support" Is there anything else I need to call to include those extensions? Thanks 回答1: ActiveSupport is more separate now in Rails 3. If

Ruby cannot load such file - active_support/core_ext/object/blank

泪湿孤枕 提交于 2019-12-18 10:21:42
问题 I was trying to run brew doctor but system popped up error of /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- active_support/core_ext/object/blank (LoadError) Searched online and another post suggested to just "gem install activesupport" but then I ran into error of: ERROR: Error installing activesupport: i18n requires Ruby version >= 2.3.0. I also tried to rvm install ruby-2.3.0 but the

How do you check the Gem Version in Ruby at Runtime?

梦想与她 提交于 2019-12-18 10:12:53
问题 Is it possible to check the gem version of the currently loaded gem in a ruby/rails app? During debugging, I would like to be able to do something like: puts RubyGem.loaded_version(:active_support) Anything like that exist? 回答1: puts Gem.loaded_specs["activesupport"].version 回答2: careful when comparing against Gem.loaded_specs['mini_magick'].version as it's not a String but a Gem::Version object ! the version string is accessible using Gem.loaded_specs['mini_magick'].version.version which is

RVM Bundle Install Missing Gem Error even though gem is installed

让人想犯罪 __ 提交于 2019-12-18 10:08:44
问题 I'm getting the following error even though I currently do have the Bundler gem installed (it appears when I run $gem list). ERROR: Gem bundler is not installed, run `gem install bundler` first. I'm using RVM and my $PATH is as follows: /Users/cjstingl/.rvm/gems/ruby-1.9.2-p290@rails3tutorial2ndEd/bin: /Users/cjstingl/.rvm/gems/ruby-1.9.2-p290@global/bin: /Users/cjstingl/.rvm/rubies/ruby-1.9.2-p290/bin: /Users/cjstingl/.rvm/bin: /Users/cjstingl/.bin: /usr/local/sbin: /usr/local/Cellar/php/5.3

Manually Retry Job in Delayed_job

不羁的心 提交于 2019-12-18 10:08:29
问题 Delayed::Job's auto-retry feature is great, but there's a job that I want to manually retry now. Is there a method I can call on the job itself like... Delayed::Job.all[0].perform or run, or something. I tried a few things, and combed the documentation, but couldn't figure out how to execute a manual retry of a job. 回答1: To manually call a job Delayed::Job.find(10).invoke_job # 10 is the job.id This does not remove the job if it is run successfully. You need to remove it manually: Delayed:

How can I get RubyGems 1.3.6 on Ubuntu 10.4

杀马特。学长 韩版系。学妹 提交于 2019-12-18 10:03:25
问题 I've just installed a new vm (VirtualBox) with Ubuntu 10.4 and Ruby1.9.1. I've got the package for RUbyGems1.9.1 but when I do gem --version I still get 1.3.5. 回答1: I got it working using gem install rubygems-update cd /var/lib/gems/1.9.1/bin sudo ./update_rubygems 回答2: This no longer works. It now gives the error message: "Since apparently nobody reads my emails, blog posts or the README: DO NOT UPDATE RUBYGEMS ON RUBY 1.9! See UPGRADING.rdoc for details." It appears the only way to get

Ruby Geolocation Gem/Plugins [closed]

匆匆过客 提交于 2019-12-18 10:00:10
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . What are the available (best) ruby IP-based geolocation gem/plugins? How do they compare to one another in terms of functionality, performance and ease of use (e.g. do they interact with a web service, or require a separate database, etc.) ? I'm hoping anyone that has used some can share their experience and

How do I specify local .gem files in my Gemfile?

孤街醉人 提交于 2019-12-18 09:57:21
问题 I have a couple of gem files which I install via gem install xx.gem . Can I tell Bundler to use them? Or do I have to specify the source path? 回答1: By default Bundler will check your system first and if it can't find a gem it will use the sources specified in your Gemfile. 回答2: This isn't strictly an answer to your question about installing .gem packages, but you can specify all kinds of locations on a gem-by-gem basis by editing your Gemfile. Specifying a :path attribute will install the gem