Opposite of Ruby's number_to_human

Looking to work with a dataset of strings that store money amounts in these formats. For example: $217.3M $1.6B $34M €1M €2.8B I looked at the money gem but it doesn't look like it handles the "M, B, k"'s back to numbers...
more »

2017-05-19 22:05 (2) Answers

Where to put paperclip models and migrations?

I'm having trouble integrating the model and migrations to my code as I'm not too sure where to put it. I learned Rails from upskillcourses, so I only learned to mix it in with user accounts, which won't be necessary for my website. Is there a file ...
more »

2017-05-18 22:05 (1) Answers

Rails 4: Public Activity Gem and Rails API

I am using the Public Activity Gem to track post for my app. Out of the box Public Activity gives me a ActivitiesController. I want to convert this controller to an API Controller so that I can make request to it from a mobile app. Below is the code ...
more »

2017-05-18 20:05 (1) Answers

ruby unable to load rubygems after compilation

I have compiled Ruby 193 and was able to load many of the modules without any issues. But when I tried to load 'rubygems' its saying false. irb(main):001:0> require 'json' => true irb(main):002:0> require 'yaml' => true irb(main):003:0&g...
more »

2017-05-17 06:05 (1) Answers

A little stumped with some code for class

I'm a little stumped with an assignment for class. So I'm supposed to take four user inputs for different hotels and have different prices. I'm having trouble with some of my If statements. When I test my program say I put "A" I get an error saying u...
more »

2017-05-16 20:05 (1) Answers

Permission error trying to bundle install

When I try to bundle install on any of my rails projects it provides me with that error. The strange thing is that this file is inexistent and even if I create it and chmod it to writeable it still fails with the same error. How can I solve this? The...
more »

2017-05-16 10:05 (0) Answers

Locate Gemfile error in Bash

I am working on getting my Jekyll blog configured, and when I ran bundle exec jekyll serve, I got the following error: Could not locate Gemfile or .bundle/ directory I cannot find the solution to this bug. UPDATE: Sorry I wasn't so clear: I have...
more »

2017-05-16 02:05 (1) Answers

Install pg gem without installing postgres macOS

This is an easy problem that can be fixed if you don't mind install Postgres database using Homebrew. But my use case, Postgres database is run by docker in the development machine and exposing port into into host. Then I need to install gem pg to d...
more »

2017-05-15 12:05 (0) Answers

Error installing devise gem

I'm trying to use devise gem on a rails app. That's what I do: rails new DeviseApp cd ./DeviseApp bundle install Then I go to the gemfile inside the project and put that code: gem 'devise' After that, I perform another bundle install Then I t...
more »

2017-05-14 23:05 (1) Answers

Faraday Gem Update locked because of Oauth2

I was trying to update Faraday Gem to 0.12.0. However, I ended up being as same since oauth2 gem has a dependency on Faraday (<0.10, >=0.8) [It says bundler has locked Faraday at 0.9.0] The "gem A" I wanted to install requires Faraday with versi...
more »

2017-05-14 03:05 (1) Answers

LoadError: cannot load such file -- bcrypt

I am trying to use bcrypt to secure users password, but when i am creating new user in database i receive this error: "LoadError: cannot load such file -- bcrypt" what i did till now: i have placed a gem in the Gemfile gem 'bcrypt', '3.1.11' i i...
more »

2017-05-13 21:05 (1) Answers

Error when running my application

I have reinstalled my operating system and installed all the necessary libraries and components to run rails, but at the moment of running my application it shows me the following error: /home/luis/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spro...
more »

2017-05-13 16:05 (0) Answers

Ruby Impressionist gem error

i wan to use this gem im my proyect on ruby on rails 4.0 but when i do all instructions of this gem in my proyect i get this error: NoMethodError in ProductsController#show undefined method `impressionist' for #<ProductsController:0x4d30400&...
more »

2017-05-13 15:05 (0) Answers

Install a Ruby gem to an arbitrary prefix

I'd like to install a Ruby gem to an arbitrary prefix. For the sake of exposition, I'm trying to install github-markup; though, I suspect I'm encountering a general issue rather than anything particular to this package. In the package's source dist...
more »

2017-05-12 22:05 (0) Answers

Creating a gem for cells components

I want to create UI components to enable users to edit data present in a specified structure. I decided to give Cells a try, but I need to encapsulate the whole code in a gem, since I want to provide this components as an extension to an existing gem...
more »

2017-05-12 15:05 (1) Answers

Ruby on rails KeyError environment variable

I experience an error : 'fetch': key not found: "APPLICATION_HOST" (KeyError)' This errors occurres since I tried to implement a new gem that requires dotenv gem. That produced a lot of tries to fix. I revert my code to a stable one but I still cann...
more »

2017-05-12 11:05 (1) Answers