rubygems

AWS Lambda: Ruby function failing to load gem

扶醉桌前 提交于 2020-01-03 19:04:16
问题 I have a Ruby Lambda function which depends on an external (ie non-AWS) RubyGem. I have a Gemfile , a Gemfile.lock and a vendor/bundle directory. Everything looks fine from a local perspective. I've tried using bundle install --path vendor/bundle and bundle install --deployment to install the gems, and am specifically including the vendor directory when zipping up the files: zip -r function.zip myfunction.rb vendor Despite this, when I test the function in the Lambda console, it's failing

Rails::Railtie: Trouble creating a Rails 3 gem

核能气质少年 提交于 2020-01-03 18:52:13
问题 I could really use another set of eyes on this so I thought I would post it here. A while ago I wrote a basic ActiveRecord Extension for my own educational purposes. I've been reading about Railties lately and thought I would try to get it working with Rails 3. I thought I would package it up as a gem to get a sense of that process as well. If I skip the Railtie and just do this as a traditional monkeypatch in the initializers folder it works fine. Using a Railtie... nothing. From the looks

Rails::Railtie: Trouble creating a Rails 3 gem

大兔子大兔子 提交于 2020-01-03 18:52:08
问题 I could really use another set of eyes on this so I thought I would post it here. A while ago I wrote a basic ActiveRecord Extension for my own educational purposes. I've been reading about Railties lately and thought I would try to get it working with Rails 3. I thought I would package it up as a gem to get a sense of that process as well. If I skip the Railtie and just do this as a traditional monkeypatch in the initializers folder it works fine. Using a Railtie... nothing. From the looks

Installing Heroku's Taps gem

心已入冬 提交于 2020-01-03 17:42:08
问题 I'm trying to use Heroku's Taps gem to get my database from their server. When I run $heroku db:pull it says I need to install the Taps gem using the command: sudo gem install taps I run this command, and as expected, Taps says it has installed ("1 gem installed"). I'm able to run the Gem update taps command without an error after installing. However, $gem list does not show Taps as installed, and I cannot see it in the gem folder at /Users/username/.rvm/gems/ree-1.8.7-2010.02@timeline

Rails 3's “bundle install” is super fast (takes 1 second), but no Rails is there afterwards? (using rvm)

纵饮孤独 提交于 2020-01-03 13:08:42
问题 I am using rvm, doing the following: rvm install ree <--- (Ruby Enterprise Edition), or this can be 1.8.7 or 1.9.2 rvm ree rvm gemset create 'proj' cd path/to/proj bundle install so Gemfile in that project says: gem 'rails', '3.0.0' and bundle install is super fast, reporting Using rails (3.0.0) but after that when I type $ rails -v /Library/Ruby/Site/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError) from /Library/Ruby/Site/1.8/rubygems.rb

How to share activerecord models via Ruby Gem

筅森魡賤 提交于 2020-01-03 12:35:25
问题 I have a couple of Rails project which have some codebase in common. The common code consists of some ActiveRecord Models and an api on top of that. Currently I am duplicating the common code in all projects which is a very bad practice. Now I want to move the common code to a Ruby Gem. I am new to Ruby on Rails. I have looked at several Gem tutorials but could not find anything useful that will help me create a gem with reusable ActiveRecord models. Essentially I want is that - Gem contains

How to share activerecord models via Ruby Gem

廉价感情. 提交于 2020-01-03 12:35:04
问题 I have a couple of Rails project which have some codebase in common. The common code consists of some ActiveRecord Models and an api on top of that. Currently I am duplicating the common code in all projects which is a very bad practice. Now I want to move the common code to a Ruby Gem. I am new to Ruby on Rails. I have looked at several Gem tutorials but could not find anything useful that will help me create a gem with reusable ActiveRecord models. Essentially I want is that - Gem contains

stub random value in rspec with secure_random

蹲街弑〆低调 提交于 2020-01-03 08:09:06
问题 I am trying to write specs for my gem, which generates otp and saves it in db. Now i am writing specs for it. so basically i have three methods generate_otp! , regenerate_otp! , verify_otp(otp) . what generate_otp! does is it calls a method generate_otp which contains three variables otp_code - basically a random value generated using secure_random otp_verified - a boolean value to set the status whether otp is verified or not otp_expiry_time - sets expiry time for otp which can be set by

no such file to load — yet file is config.gem in environtment.rb file in rails

北战南征 提交于 2020-01-03 06:18:07
问题 I keep getting this error for different gems, the most recent is acts_as_reportable: no such file to load -- acts_as_reportable However, I have the following line in my environment.rb: config.gem 'acts_as_reportable' And I also ran the following: >gem install acts_as_reportable It it output: >gem install acts_as_reportable Successfully installed acts_as_reportable-1.1.1 1 gem installed Installing ri documentation for acts_as_reportable-1.1.1... Installing RDoc documentation for acts_as

Ruby: require 'irbtools' raises LoadError

怎甘沉沦 提交于 2020-01-03 05:17:12
问题 I installed the irbtools gem, but I can't require it. $ sudo gem1.9.1 install irbtools Successfully installed irbtools-0.8.7 1 gem installed Installing ri documentation for irbtools-0.8.7... Building YARD (yri) index for irbtools-0.8.7... Installing RDoc documentation for irbtools-0.8.7... $ gem1.9.1 which irbtools # yup, installed OK /var/lib/gems/1.9.1/gems/irbtools-0.8.7/lib/irbtools.rb $ ls /var/lib/gems/1.9.1/gems/irbtools-0.8.7/lib/ irbtools irbtools.rb $ ruby1.9.1 -e 'require "irbtools