FAQ Database Discussion Community


Rails Fetch record from instagram using cron job

ruby-on-rails,gem,instagram-api,cron-task
I am using instagram gem and I need to fetch users media from instagram using users instagram id. I already have instagram user id into users table. I have a few questions Does Instagram gem give any method which pass user id and fetch users media? How can I fetch...

how to solve“ DL is deprecated, please use Fiddle” Rails 4.1.8?

ruby-on-rails,installation,gem
i install ruby on rails package, and check the version. when i check rails version it show DL is deprecated, please use Fiddle. How to solve DL is deprecated, Please use Fiddle ? i am using Windows 8.1 thanks before....

Executable “require” can't find it's own library

ruby,gem,rubygems
I am making a ruby gem with an executable and a class library. The executable has require "fpa/chklinks" which is the class library in lib/fpa directory. I get the following error when I run my executable named chklinks.rb: $ bin/chklinks.rb -h /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- fpa/chklinks (LoadError)...

Association Error with Sorcery Gem in Rails

ruby-on-rails,ruby,authentication,gem,sorcery
I used Sorcery to set up authentication in Rails and I'm trying to create a model where the user id for the user is linked as reference to the model for data entered, but I get an error: Couldn't find User without an ID it refers to the following code:...

how to localize Russian date?

ruby-on-rails,ruby-on-rails-4,gem
please help solve the problem. I use gem russian. the following code works: <div class="col-sm-3"><%= Russian::strftime(Time.now) %></div> but I need to work the following code: <% @all_diary.each do |diary| %> <tr> <td> <%= link_to user_path(diary.id) do %> <div class="col-sm-3"><%= diary.name %></div> <div class="col-sm-3"><%= diary.created_at.to_time.strftime('%e %b %Y') %></div> <div class="col-sm-3"><%= diary.updated_at.to_time.strftime('%e...

How to package the killbill hello-world plugin

ruby,gem,jruby
I'm a ruby beginner trying to package a ruby gem from killbill. I tried debugging the problem but no luck. When running rake killbill:package an exception is thrown: NoMethodError: undefined method `pos' for <Pathname:/usr/local/rvm/gems/jruby-1.7.19/cache/i18n-0.7.0.gem>:Pathname The plugin is available here: https://github.com/killbill/killbill-hello-world-ruby-plugin I followed the README to build the package and I'm...

How to write a Ruby gem that can be invoked without the word 'ruby' preceding it

ruby,gem
I would like to write a CLI application wrapped into a Gem that can be invoked the same way git commands are invoked, or gem commands. Eg when running say "git clone " you don't need to precede it with 'ruby'. However, the tutorials and articles I've seen so far...

using devise WITHOUT the gem, can I simply copy the files?

ruby-on-rails,ruby,devise,gem,rubygems
Could I simply copy the devise app and lib (and gem?) folders into my respective project folders and have them work just as if I was using the gem? I'd like to do this so that I can really see all the code, possibly do some customization, and also avoid...

Sass installation issue in Windows 7

ruby,gem,sass
I am trying to install sass for the first time. Followed the following steps: Installed Ruby 2.1.5 in Windows 7 64 bit from http://rubyinstaller.org/ successfully ruby -v in cmd ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32] gem install sass in cmd I got the following error: ERROR: Could not find a...

Error installing nokogiri in ubuntu 14.0.4 (Ruby 1.8.7)

ruby,ubuntu,gem,install,nokogiri
I'm trying to install the bundle(bundle install) in Ubuntu 14.0.4 installed Ruby 1.8.7.And it fails to install the bundle and displayed the error: An error occurred while installing nokogiri (1.4.7), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.4.7'` succeeds before bundling. so now I tried to...

error while deploying diaspora on heroku Failed to install gems via Bundler

ruby-on-rails,heroku,gem,bundler,diaspora
i am trying to deploy diaspora on heroku but getting this error while deploying am using rails 4.1.8 with ruby 2.0.0 on ubuntu 14.04 I had tried bundle update but it doesn't worked..any solution..?? > [email protected]:~/diaspora$ git push -u heroku heroku:master > Counting objects: 132081, done. > Delta compression using...

Make a gem generation run a rake task?

ruby-on-rails,ruby,gem
I've made a gem which uses the rails generators. It creates certain files including a database migration. Is there any way of running the 'rake db:migrate' task automatically? After the user has ran the install. Or is there a way of creating an 'ask' in the form of a 'Run...

Rails doesn't load actionform gem from Gemfile

ruby-on-rails,gem,rubygems,bundler
My Rails 4.2 app fails to load some GitHub hosted gem (installed via bundler v1.8.2). I am using rvm 1.26.10 (master) In my Gemfile, gem 'simple_form', '~> 3.1.0' gem 'actionform', :github => 'rails/actionform' Bundler install them in different location: $ bundle show simple_form /Users/me/.rvm/gems/[email protected]_app/gems/simple_form-3.1.0 $ bundle show actionform /Users/me/.rvm/gems/[email protected]_app/bundler/gems/actionform-4a858fecf4c2 Rails...

Activemessaging caused infinite loop in my Rails app

ruby-on-rails,gem,activemessaging
In my rails app, activemessaing caused an infinite loop, e.g. when I run bundle install, an error message is given: "Your Gemfile requires gems that depend on each other, creating an infinite loop. Please remove gem 'activemessaging' and try again." Any ideas? Gemfile source 'https://rubygems.org' #gem 'dotenv-rails', :groups => [:development,...

How do I Monkey-patch a gem with a hierarchy?

ruby,gem,thor
I'm trying to add a new method to the Thor gem. Specifically, I want to add a method to Thor::Shell::Basic. In my gem based on thor, in bin/mycommand, I have this: require 'thor' require 'ext/thor/extension' Thor.include ThorExtensions::Thor::Shell::Basic MyCommand.start In lib/ext/thor/extension.rb, I have: module ThorExtensions module Thor module Shell module Basic...

failed to require a local gem

ruby,gem
created a demo gem built it : gem build control.gemspec Successfully built RubyGem Name: process_controller Version: 0.0.1 File: process_controller-0.0.1.gem installed it: gem install --local process_controller-0.0.1.gem Successfully installed process_controller-0.0.1 1 gem installed but I can't seem to require it : irb (from the installed directory) 2.1.5 :001 > require 'process_controller' LoadError:...

Ruby Compass ERROR: Failed to build gem native extension

ruby-on-rails,ruby,gem,compass
Hi I am running Ubuntu 15.04 and I am trying to install the Compass gem. I did a gem update like the Compass website told me to do. Then I tried to install Compass and got the following error. Building native extensions. This could take a while... ERROR: Error installing...

What kind of dependencies must be in Gemfile and in gemspec?

ruby-on-rails,gem
Cant figure out where rails gem must specify its dependencies? In Gemfile on in gemspec? The generated Gemfile has these description: # Declare your gem's dependencies in malibu.gemspec. # Bundler will treat runtime dependencies like base dependencies, and # development dependencies will be added by default to the :development group....

Extract a path from the output of `gem environment` using sed

regex,sed,gem,extraction
Executing gem environment returns the following output: RubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux] - INSTALLATION DIRECTORY: /var/lib/gems/1.8 - RUBY EXECUTABLE: /usr/bin/ruby1.8 - EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin - RUBYGEMS PLATFORMS: - ruby - x86_64-linux - GEM PATHS: - /var/lib/gems/1.8 - /root/.gem/ruby/1.8 - GEM CONFIGURATION:...

Loading Rails environment and classes from an independent gem

ruby-on-rails,ruby,gem
I have an app environment that we validate using an automated script. It populates some setup data in the Rails app and then sends a number of requests to validate some external workflows. Afterwards it removes the setup data from the database and cleans up other associated files. The problem...

Rails Gemfile Clarification

ruby-on-rails,ruby,gem
So despite the fact I've created 3 rails apps of increasing complexity on my own. I haven't deployed any of them. I decided tonight to create another app (Well really redoing an older app with some new things I've learned) and it hit me. I really don't completely understand the...

How to change default gem version

ruby,json,gem
Any help would be greatly appreciated! I tried to reconfigure my GitLab after running a bundle update. But ran into the error listed below. Most of the time this type of error is reported the gem that it is conflicting with will be listed in the error, but mine just...

Gem installation fails after use of Bundler for cups gem

ruby-on-rails,ruby,gem,bundler,rbenv
So I'm currently working on a project with RoR in a linux environment that involves a print server. We're using CUPS (see http://cups.org). I'm trying to bundle all the various gems that I'm using but this is the only one that doesn't work. I've cp'd the command prompt output and...

Rails UK cities and districts gem

ruby-on-rails,ruby,gem
People have asked this before but are usually told to use Carmen, which is no longer maintained. The Countries gem has something close to what I want, except there are no districts, like 'Ibrox', 'Mount Florida' or 'Dagenham'. Does anyone know of a gem that does this?...

Not able to make connection with rest API of Salesforce using Faraday gem

ruby,ruby-on-rails-3,ruby-on-rails-4,gem,salesforce
Why we are getting this error when trying to make connection with Salesforce rest API through Faraday gem using ROR? Faraday::Error::ConnectionFailed: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ...

gretel gem in rails engine

ruby-on-rails,gem,erb,breadcrumbs
i am working with Rails 4.1.8. Is here someone who worked with gretel in an rails engine before? How do I get breadcrumbs into my rails engine? Can someone post an working example, that would be great, thanks!

How to install a rubygem from inside a ruby script and require this gem afterwards?

ruby,gem,rubygems
I would like to do something like this: begin require 'progressbar' rescue LoadError => e puts "exception .. installing with gem" h = system 'gem install progressbar' puts "gem installed #{h}" require 'progressbar' end pbar = ProgressBar.new("test", 100) 100.times {sleep(0.1); pbar.inc}; pbar.finish but obviously if you run this snippet, the...

Ruby byebug never stops

ruby-on-rails,ruby,gem,rubygems,byebug
Ruby byebug never seems to stop in any of my code. It installed properly without errors. I did a bundle update byebug as well as gem pristine byebug. I start the rails server with this command rails s -e development Here's the gem file source 'https://rubygems.org' #ruby '2.0.0' gem 'multi_json',...

How to edit and test a gem I forked?

ruby,gem
I know that I can specify the location of the gem in a GEMFILE but what if I don't want to use a dummy rails app? (or if I did use a dummy rails app how would I do this?) Essentially, what if I wanted to do the the equivalent...

The bundle currently has rails locked at 3.2.12. whats to do?

ruby-on-rails,ruby,gem,bundle
I've changed in my gemfile the rails version from 3.2.12 to 4.2.0 then I got this error: The bundle currently has rails locked at 3.2.12 so I tried bundle update / and bundle update rails ... but I got this: Bundler could not find compatible versions for gem "rails": In...

Openshift Port forwarding

ruby,ssh,gem,openshift
There already a lot of topics about it. But I'm stuck I configured ssh with succes! Now I like to configure the portforwarding for connection with TOAD. I used this tut: https://blog.openshift.com/getting-started-with-port-forwarding-on-openshift/ Now when I try rhc port-forward -a php I get this error Could not parse PKey: no start...

Rails not working anymore… I think I messed up

ruby-on-rails,ruby,gem
I think I screwed up and now I'm stuck with this error message :( How do I get out of here? [email protected]:~$ rails -v /Users/pedal/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'actionpack' (= 4.2.1) among 62 total gem(s) (Gem::LoadError) Checked in 'GEM_PATH=/Users/pedal/.rvm/gems/ruby-2.2.1:/Users/pedal/.rvm/gems/[email protected]', execute `gem env` for more information from /Users/pedal/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1311:in...

Remove Tables from Schema

ruby-on-rails,database,gem,rails-migrations
This is probably a fairly basic question, but I'm at a loss on how to clean up after installing a gem I decided not to use. During the install process of Attachinary, the install instructions said to run rake attachinary:install:migrations - creating a new table and index in my schema,...

Server can't find file 'will_paginate' after will_paginate gem installed

ruby-on-rails,ruby,file,gem,will-paginate
I have gem 'will_paginate', '~> 3.0.6' installed on my app. But when I add the code //= require will_paginate into my application.js and try to load a page, I get the following error: Couldn't find file 'will_paginate' Does anyone know why my server might not be able to find the...

Deploying Ruby app to Elastic Beanstalk with custom extension, unable to load compiled file

ruby-on-rails,ruby,gem,elastic-beanstalk
I've been working on a Ruby extension for a project of mine, and I've gotten to the point where I'm ready to deploy it to elastic beanstalk. I decided to make a gem, not because it would really be useful to anyone else, but mostly just because I've never made...

How to require a Ruby gem directly from its path?

ruby,gem,zip
In order to work with rubyzip i installed the gems: gem install --local rubyzip-1.1.7.gem gem install --local zip-zip-0.3.gem In my code i call the gems using the require method: require 'zip/zip' require 'zip/filesystem' I want to use require to load the gems directly from their location on my machine. i...

Building gem, executable not found

ruby,gem
I'm in the process of writing my first ruby gem and I'm a little new at the whole structure of setting up gems. My understanding from reading this guide is that in order to create an executable for my gem I need to do the following: Add a line to...

how should I publicly announce a new ruby gem?

ruby,gem
I just made my first ruby gem and pushed it to rubygems.org. I'd like to make its existence known to anyone who might be interested, for testing and feedback. What's the best, most canonical way to do that?...

Does Ruby support nonblocking HTTP requests without a third-party library?

ruby,http,asynchronous,gem,eventmachine
I am writing an API to access resources on one of my servers. Part of this API will make HTTP requests. In the name of good software design, I don't want my API to be blocking. I am fairly new to Ruby, but in Java I would provide an Asynchronous...

undefined method `namespace'

ruby-on-rails,ruby,gem,sinatra
I'm trying implement a namespace(with sinatra-contrib gem) routing for Sinatra app and have an error after I'm trying to start the server: undefined method `namespace' for GuessApp:Class app.rb require 'sinatra' require 'sinatra/namespace' require 'haml' require_relative 'routes/init' require_relative 'models/init' require_relative 'helpers/init' class GuessApp < Sinatra::Base register Sinatra::Namespace end routes/init.rb require_relative "books"...

Booking GEM recommendation - Rails4 [closed]

ruby-on-rails,ruby,gem
could one recommend a very good gem for creating a booking system. i would like to create a similar website such as www.airbnb.co.uk where users can book dates to rent an item (where as in the case of airbnb its booking an apartment). there are many out there, but if...

how to personilize “bootstrap-generators” gem

ruby-on-rails,twitter-bootstrap,gem,sass
Right now I'm feeling really dumb but I can't find a way to personalize the color in the gem "bootstrap-generators" I've tried to edit the color in bootstrap-variables.scss but is not working. Bootstrap is correctly installed because it works and I tried to delete the cache folder to force rails...

Ruby on Rails 4.2 with Globalize gem for UUID table

ruby-on-rails,postgresql,gem,uuid,globalize
I use Globalize gem for my rails 4.2 project, and the table primary ID is UUID in postgre. Here is the table migration codes and created translation table foreign key is integer type, not UUID. class CreateMessageThreads < ActiveRecord::Migration def up enable_extension 'uuid-ossp' create_table :message_threads, id: :uuid do |t| t.integer...

If-else and error handing in command prompt

shell,powershell,cmd,gem,appveyor
I am trying to detect if certain ruby gem is not installed, install it first and then proceed. For instance: gem which rails returns path to gem's driver file (.rb) on stdout, if gem exists, if not it checks throws error on stderr. How can I solve it? Pseudo code:...

Why the module `ClassMethods` defined and extended in the same namespace?

ruby,gem
I am trying to understand code from github repo. It's the main module of the gem to setup the client. module Github # more code class << self def included(base) base.extend ClassMethods # what would this be for? end def new(options = {}, &block) Client.new(options, &block) end def method_missing(method_name, *args,...

gem and ruby commands causing `require': cannot load such file — monitor

ruby,gem,redhat
I am installing ruby on a red hat 7 server. any commands using gem or ruby, such as $ gem or $ ruby, produce the following error: /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:7:in `require': cannot load such file -- monitor (LoadError) from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:7:in `<top (required)>' from /usr/share/rubygems/rubygems.rb:1107:in `require' from /usr/share/rubygems/rubygems.rb:1107:in `<top (required)>' from <internal:gem_prelude>:1:in `require'...

uninitialized constant User (NameError)

ruby-on-rails,ruby,gem,factory-girl,rspec3
I have a gem where I have moved the core parts of all the models from my main app into modules that are essentially mixins or "concerns". Thus allowing me to use those mixins from the gem in models of various applications and thus allowing me to replicate the tables...

Can I use limits, orders or date queries with the Ruby DBF gem?

ruby-on-rails,ruby,import,gem,dbf
I'm referring to this gem: https://github.com/infused/dbf I've read the readme and scanned through the API documentation. It feels like I should be able to use ActiveRecord style queries on a DBF Table but it doesn't look like it. I'm hoping to get the last X records, query by date or...

Make responders gem a dependency in gemspec?

ruby-on-rails,ruby,gem,rubygems
I have a gem which requires the 'responders' gem. Below I've posted a section of my .gemspec file. Whenever I install my gem I always get the responders/rails-upgrade error message. Why would this be happening when an app is using my gem? Are these dependencies correct? s.add_development_dependency 'bundler', '~> 1.8'...

rails uninitialized constant Sprockets::SassCacheStore

ruby-on-rails,ruby,sass,gem,sprockets
I'm new to rails and trying to do some playing around with gems and such. My case here is that I have this navigation menu on my website and I needed to get the current_page link selected.. rather than building a helper I wanted to install a gem so I...

CircleCI gems caching

ruby-on-rails,gem,bundler,circleci
Is it possible to cache gems, so that bundle install will not install bunch of gems for every build? This takes 5 minutes on every build, that is too much. I've added this to the circle.yml config: dependencies: cache_directories: - "/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/" This is the common directory which is provided by...

Ruby C gem memory pollution between runs

c,ruby,gem
I wrote a gem in C that appears to be keeping polluted memory between runs. I noticed this in the past, but have finally discovered how to reproduce it consistently by calling the Gem in RSpec with Spring. When running this single RSpec example after restarting Spring, the example always...

heroku run rake db:migrate fails, gem pg not found; gem install pg repeats

ruby-on-rails,ruby,postgresql,heroku,gem
I am a beginner at rails, trying to push my tiny app to heroku. Locally I have moved my database from mysql2 to postgresql, but unable to run my app on heroku. Locally everything is running as expected. production: adapter: postgresql database: database_production pool: 5 timeout: 5000 Running either heroku...

Selecting Ruby gems at run-time based on configuration

ruby-on-rails,ruby,dependency-injection,gem
We're writing a Rails app that we want to be able to talk to any of several external data repositories via a uniform adapter interface, and we'd like to be able to add more later just by writing new implementations of that adapter interface (cf. ActiveRecord adapters). Any one installation...

python tool to create skeleton for PyPI package?

python,gem,pip,cpan,pypi
I want to write my first python package that I can upload to PyPi. My question is is there any tool to initialize the required skeleton for the PyPi package ? So far I have found instructions here http://peterdowns.com/posts/first-time-with-pypi.html but it requires me to create all the files manually. I...

Trying to push Rails 4.2.1 app to Heroku sqlite error

ruby-on-rails,heroku,gem
So I read the thread on that similar question, but still confused. This is my gem file. I changed all the sqlite3 gems in my gemfile to gem 'pg', '0.7.0' I changed the all the sqlite3 in the database.yml file to postgresql. I did a bundle install, and then heroku...

Bundler installing gem that's already installed

ruby,gem,chef,bundler
I believe I'm misunderstanding the way bundler works, but from the bundle install documentation it seems to indicate bundler will use locally installed system gems. ... --system: Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application ... The --system...

How to access the class name inside the gem code

ruby-on-rails,ruby,gem,rubygems
So I'm creating an acts_as kind of gem, and inside the gem I want a reference to the class that is including the gem, to define methods using its name, like for example class MyObject < ActiveRecord::Base acts_as_whatever end I want to define methods from the gem using that class's...

Don't know how to build task 'generate_secret_token'

ruby-on-rails,database,gem
i need help. i'm getting this error when i run: rake generate_secret_token rake aborted! Don't know how to build task 'generate_secret_token' /usr/local/rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `eval' /usr/local/rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `<main>' (See full trace by running task with --trace) when i run full trace rake generate_secret_token --trace this is what im getting; /usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/lib/rake/task_manager.rb:62:in `[]'...

Manipulate webpage and have it send back results using ruby

ruby,gem
so here it is: I use ruby to get user input, the easy way..say I request 2 inputs: input1 = gets.chomp input2 = gets.chomp Now I would like to send this information to say, a search engine that takes these two options separately and does the search. How can I...

Install a ruby gem from a local repository

ruby,gem,git-repo
I have a git repository locally which contain a SDK project in ruby. I want to install the gem file from this local repo. It has the gemfile and gemspec files as well. Please help me on this. I tried to find a solution online but all of them are...

Autocomplete gem for a rails app [closed]

javascript,ruby-on-rails,gem
I'm looking for suggestions on autocomplete gems for a rails app. I'll be searching for users and would like it to display a list underneath (similar to facebook). Any suggestions?

How to grant a folder with write permissions for installing gems in Ruby

ruby-on-rails,ruby,gem,install
the biggest problem I have with installing anything on my computer related to Ruby and Rails, is not having 'write' permissions to a specific folder. For example: "You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory" Instead of always using Sudo command, which sometimes doesn't solve the problem, how can...

Rails gem for tennis court bookings?

ruby-on-rails,ruby,devise,gem
I would like a page, /bookings to display a table with three columns, headed "Time", "Court One" and "Court Two". The time column would contain every hour timeslot the current day from "7 to 8 am" to "9 to 10 pm". All the other cells would either show the current...

cannot load Java class kafka.consumer.ConsumerIterator

java,ruby,gem,rvm,jruby
Im using the following gem https://github.com/joekiller/jruby-kafka I have java installed: $ java -version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) and using jruby-1.7.19 After a succefull bundle install I have the following error when trying to execute my app...

How to identify a set of dates from a string in rails

ruby-on-rails,ruby,regex,string,gem
I have the following strings "sep 04 apr 06" "29th may 1982" "may 2006 may 2008" "since oct 11" Output "September 2004 and April 2006" "29 May 1982" "May 2006 and May 2008" "October 2011" Is there a way to obtain the dates from these string. I used the gem...

Classwide method in ruby gem

ruby,class,methods,module,gem
How can you define c method that is accessible from class One and Two? module MyGem class One def a c end end class Two def b c end end end ...

How to install the aws sdk gem

ruby-on-rails,amazon-s3,gem
When I run the command on my rails app gem install aws-sdk I get the following error: ERROR: Error installing aws-sdk: invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Users/grantspilsbury/.rvm/gems/ruby-2.2.1/cache/aws-sdk-core-2.0.43.gem I am trying to use Amazon's S3 storage service. My gemfile includes ruby...

building generator in gem for rails 4

ruby-on-rails-4,gem,rails-generators
I have looked and tried various things in regards to creating a gem with a generator. Maybe my tiredness is causing me to forget something or maybe its just my lack of experience. Either way I am trying to understand how to build a gem that is a simple generator...

Handling dollars in rails with gem

ruby-on-rails,ruby-on-rails-4,gem
I have a rails 4 application that has a form with many dollar input fields (all inside the same model). I've made all of the fields decimals with precision => 10 and scale => 2. The issue I'm having is the input fields are masked with commas separating every '000'....

Socialization likes

ruby-on-rails,ruby-on-rails-4,gem,like
I start to use Socialization gem. So, created User model with devise: class User < ActiveRecord::Base has_many :posts devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable acts_as_follower acts_as_followable acts_as_liker end Then I created Post with scaffold: class Post < ActiveRecord::Base belongs_to :user acts_as_likeable end And I want to allow user like...

How to get Bitters working in Jekyll?

gem,sass,jekyll,bourbon
I have been using Bourbon and Neat in Jekyll with no problems. I am now trying to add Bitters to the mix, but am having problems. I have installed Bitters using gem install bitters and it works in non-Jekyll projects. My _config.yml file contains gems: [bourbon, bitters, neat]. My scss...

Cannot install RMagic gem

ruby-on-rails,gem
I'd like to install RMagic gem, I got “Can't find Magick-config” so I installed $ sudo apt-get install libmagickwand-dev but now I get following output: Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /usr/local/rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20150526-12203-xr9xf7.rb extconf.rb checking for Ruby version >= 1.8.5... yes checking for gcc... yes checking for...

AWS SES Timeout

ruby,amazon-web-services,gem,ruby-on-rails-4.2
I am using Rails 4.2, the AWS-SES gem and the Mailform gem. I am trying to set up AWS SES in development and have added this to config/development.rb: # Configure mail using AWS SES config.after_initialize do ActionMailer::Base.delivery_method = :amazon_ses ActionMailer::Base.custom_amazon_ses_mailer = AWS::SES::Base.new( :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'], :access_key_id => ENV['AWS_SECRET_KEY_ID'], :server =>...

Wicked, after delete action redirect_to

ruby-on-rails,controller,gem,destroy
I have used wicked gem for my form. The thing is when user uploads photo they can see at the same page as ..../steps/picture. At Picture page user can destroy the picture. When user clicks I would like them to redirect_to steps/picture page but whatever I tried I get error...

How to install a ruby gem

ruby,gem,rubygems,colorize
I'm trying to write a program with colorized output. I looked at a few, and the gem I found was colorize. I've done some research, but I can't find step-by-step instructions on how to install a gem, require it, and use it. The gem I want is colorize, and I...

Shoppe gem each method on product categories

ruby-on-rails,ruby-on-rails-4,methods,gem
Just wondering if anyone with any experience with Shoppe know how to call an each method on product categories? I'm trying to do something like this : <% Shoppe::ProductCategory.each do |prod| %> <li><%= prod.name %></li> <% end %> but I'm getting an undefined method error. Is there some special method...

How to deal with forked gems and bundle

ruby-on-rails,git,github,gem,bundler
I've forked a gem and it is hosted on Github. Then, in Gemfile this is what I've got: gem 'mongoid-scroll', git: 'https://github.com/bgvo/mongoid-scroll.git' Whenever I make changes to the gem using Pry gem-opem command, changes are saved under the following directory: /Users/borjagvo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/ruby/2.1.0/bundler/gems/ Some things confuse me: 1) In this directory there...

Rails s and bundle install error with pg gem?

ruby-on-rails,ruby,ruby-on-rails-3,devise,gem
I am trying to install Ruby on Rails on my MacBook Pro running Yosemite 10.10 for my school program. I have installed everything successfully but now when I run rails s I get this error. I have tried to continue with bundle install to solve the issue but as you...

Specific test behaviour for ruby gem — mocking sleep

ruby,rspec,gem
So I made a ruby gem that makes use of the sleep function. Using the gem in my applications causes the sleep function to be called in my tests. What is the preferred approach to dealing with this? Right now, I'm mocking out sleep in the application but is there...

Why is bundler requiring an extremely old version of a gem when version not specified?

ruby,gem,bundler
I have a Gemfile that looks like this: gem 'google-api-client', :require => 'google/api_client' gem 'my_baseimage', '0.0.3', :git => 'https://github.com/xxx/BaseImage.git' I have a base gem that requires a bunch of common gems across projects. However, when I run bundle install, I see errors like this: In Gemfile: activerecord (>= 0) ruby...

Bundler can't find a gem that I can install using gem install

ruby,gem,bundler,rbenv
I am developing two gems side-by-side, one that contains some pure ruby functionality and one with an interface for Rails. The Rails gem (rwanda-rails) depends on the pure Ruby gem (rwanda) with spec.add_runtime_dependency "rwanda" "~> 0.6.0" in the .gemspec. However, for some reason bundler can't find this new version --...

“PHP Composer” compared with “Ruby Gems and Bundler”

php,ruby,gem,composer-php,bundler
(As first, this question is not "which is better" question. I just want to know how they are similar and differ in functionality perspective.) I'm php developer and currently learning ruby. In these days, many php developers are encouraged to use Composer for dependency management. Before asking questions, I would...

mysql ruby gem not installing on Windows 7

mysql,ruby,windows-7,gem,rubygems
Not a duplicate. This question is mysql gem and the other question is mysql2 gem. They do have the same answer though, but the other question's answer doesn't tell what the solution is explicitly. The answer is hidden in the comments. See yellow text of the answer for this...

Bundle install: ERROR: Failed to build gem native extension. nio4r gem

ruby-on-rails,ruby,gem,rvm,bundler
I'm currently working on a project using: rvm 1.26.11 ruby 2.2.1p85 I tried to run bundle install but keep getting the following error: Gem::Ext::BuildError: ERROR: Failed to build gem native extension. and, following: An error occurred while installing nio4r (1.0.0), and Bundler cannot continue. Make sure that `gem install nio4r...

How to install gem via Makefile if it doesn't exist

ruby,makefile,gem
I'm creating a Makefile for my project: build: sudo gem install sass Any time I build it's asking me for my superuser password. If I remove sudo it will not install at all, but throw an error instead, as I don't have permissions to install a gem. So I came...

How to install a gem globally without sudo using rbenv?

ruby,gem,sudo,rbenv
I am using rbenv and I am trying to install sass without success. So, I installed rbenv via Homebrew, then Ruby 2.2 (rbenv install 2.2) and finally gem install sass, but I was unable to make sass available on my $PATH. Short on time, I sudo gem install sass using...

Is there a Rails gem for management of a “multi-visit pass” scenario?

ruby-on-rails,gem,user-accounts
I'm a Rails noob. I'm looking to implement an application where users can purchase a multi-visit pass, then spend the credits week-by-week. For example, register and login, then purchase 10 visits at a gym - the system should list 10 remaining visits. Sign up to a class and 9 remaining...

Ruby gem spreadsheet returning dates as doubles

ruby,excel,postgresql,gem,spreadsheet
I have a method that runs through an excel spreadsheet and puts those values into an array then into PostgreSQL. Everything runs fine but the cell values that hold dates are being returned as doubles. How can I get the date values? Also what if I don't know when a...

How can I add a print method for Audited gem in Rails?

ruby-on-rails,ruby,gem,acts-as-audited
I'm using the gem Audited in my Rails app. I want to create a way to print out the Audit record so I can have a feed of what has been changed by a User, or what has changed on an object. Currently, I have setup a method called print_audit...

Can someone help me with installing Devise?

ruby-on-rails,ruby,devise,gem
I have added the gem 'devise' to my Gemfile. Everything installs fine, but when I run rails generate devise:install, I get this error. jshuadvd:estuk joshuadavid$ bundle show devise /Users/joshuadavid/.rvm/gems/ruby-2.1.2/gems/devise-3.4.1 jshuadvd:estuk joshuadavid$ rails generate devise:install /Users/joshuadavid/.rvm/gems/ruby-2.1.2/gems/activerecord-4.1.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `devise' for Install (call 'Install.connection' to establish a connection):Class (NoMethodError) from...

cannot load such file

ruby,gem,require
I am building my own first Gem. After I created some functionality I ordered all the files like to the best practice of gem building. I moved all the files to right folders. The executable is in bin/boss-mailer, the rest is put all in the lib folder like: The executable...

How can I alter a gem on heroku?

ruby-on-rails,ruby,heroku,devise,gem
I recently deployed my app to heroku. It uses Devise, which I had to alter the after_sign_up_path so it would redirect correctly to a set page after someone signs up. This works fine locally, but when I deploy on heroku it installs the original unmodified devise gem. Does anyone know...

How to make C library for ffi during `gem install`

ruby,gem,ffi
Recently I wrote a gem using ffi. With this help, the ruby code can call the C extensions with a dynamic library, which I compile all C extensions into. My gem structure is like this: . ├── ext │   ├── common.c │   ├── common.h │   ├── Makefile │   └── ......

Ruby gems path issue (system vs brew)

ruby,gem,homebrew
I'm having an issue with homebrew looking to the system gems when the system gems aren't in the $PATH. Here is my gem env to show that my gems are installed in my .rvm/gems directory: RubyGems Environment: - RUBYGEMS VERSION: 2.4.5 - RUBY VERSION: 2.2.2 (2015-04-13 patchlevel 95) [x86_64-darwin14] -...

An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue

ruby-on-rails,ruby,gem,bundler
I tried to open the rails console, but found the error as below: rails c Could not find nokogiri-1.6.0 in any of the sources Run `bundle install` to install missing gems. then I run the bundle install Installing nokogiri (1.6.0) Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/liuxingqi/.rbenv/versions/1.9.3-p0/bin/ruby extconf.rb...

How can I make an instance persist across requests in Sinatra?

ruby,gem,sinatra
I'm using Sinatra to build a very simple 'command center' to control various USB devices. I have created classes like class Device and subclassed the various types of devices. The problem is that, I don't want to use a database to store all my information. The list of devices will...

Is there a gem to shorten large numbers like Twitter does for followers?

ruby-on-rails,gem,numbers
For example: 410589 actually shows up as 410K 4509 actually shows up as 4K 349 actually shows up as 349 I'm looking for a way to shorten very large numbers into a nice to read format....

ActiveAdmin ::Show 4 textbox in active admin using has_many relationship

ruby-on-rails,gem,activeadmin
I have one poll table having with question filed and each question have 4 answer which is has_many relation ship with answer table class Poll < ActiveRecord::Base has_many :answer end My answer model class Answer < ActiveRecord::Base belongs_to :poll, :class_name => "Poll", :foreign_key => "question_id" end My active admin form...

'Bundle' issues with ruby gem 'gamebox'

ruby,linux,gem
I'm working with the gem 'gamebox' for the first time and I'm running into issues. I have the gem installed and generated the template the guide instructs me to, however when I attempt to bundle it it throws this error detailed below. $ bundle install --path lib/dependencies Fetching gem metadata...