Gem installation fails from custom repo

Wanted to install a gem from custom gem repo. Here are the steps which i followed 1. Created a gem and copied it to gems folder under gems_repo. 2. Run the command gem generate_index. This command created some files. I copied the files to http://ex...
more »

2017-02-16 12:02 (0) Answers

Download single record in CSV in Rails

I'm using ruby csv library. When I'm trying to download multiple records it is working fine and downloading all the records in CSV file. @assets = Asset.all respond_to do |f| f.html f.csv { send_data @assets.to_csv } f.xls { send_data @assets....
more »

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

Ruby/Rails equivalent to a C++ enum

My rails app can make telephone calls. I want a set of constants that define how calls will be conducted. When a call starts, one of three things could happen, depending on a configuration constant. They are 1) Ask the user to press a key to start t...
more »

2017-02-15 00:02 (1) Answers

Gem update issue with ruby 2.2.2

I was trying to update my ruby 1.9.3 to 2.2.2, and when i test in local that all was working fine, but when i try to push to heroku i got the raindrops issue version and then i update the rain drops by command bundle update raindrops but after th...
more »

2017-02-14 18:02 (1) Answers

Variable interpolation in user generated content

Say for example I was building my own CMS for a restaurant and I had a page where the website owner could go in and write his own descriptions for each meal that were managed via the backend. Let's also assume that each meal has a name and price ass...
more »

2017-02-13 14:02 (1) Answers

Ruby - Configuring alternate DNS for Redis

We heavily pound Redis with our infrastructure (approx. 8K requests a sec). Especially because Redis is our job messaging system as well (we use Sidekiq). Now, many times we get the following errors: RuntimeError: Name or service not known RuntimeE...
more »

2017-02-13 10:02 (0) Answers

Ajax won't send post to rails app

I have a webpack frontend with a rails backend. They are running on different ports, and I believe this is causing me problems when I am trying to post form data to one of my rails controller end points. I have googled for a few hours and I am gettin...
more »

2017-02-12 18:02 (1) Answers

Creating a Whatsapp like model in Rails Framework.

Background: I am new to Rails and I have gone through Michael Hartl Ruby on Rails tutorial. I have read Agile Web Development with Rails 5. So for practice I was trying to design WhatsApp like framework and got stuck while creating User and Group mod...
more »

2017-02-12 11:02 (3) Answers

Downgrade/Revert Ruby Version on Heroku

I recently updated my Heroku app from Ruby 2.3.1 to 2.4.0, but I now need to revert back to version 2.3.1. To Update: I changed the version in the Gemfile from 2.3.1 to 2.4.0. Everything went fine, but I need to go back to 2.3.1 because of problems...
more »

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

::Rails::Engine - No route found

I'm using ruby 2.4 and rails 5. I'm trying to write my first gem and setup an engine to mount some basic controller logic. I have the following as my engine: Foo::Bar::Mylib::Engine.routes.draw do resources :controller end My package structu...
more »

2017-02-11 14:02 (0) Answers

How can I use JSON data with Ruby?

This seems really simple but I've looked all over and I can't find any documentation for this. I have the following json file: //data.json { "movie1": [ {"name": "Inception"} ]} and I just want to print the value of name with Ruby. json = ...
more »

2017-02-11 00:02 (1) Answers

React testing setup with rails/webpacker

I've added webpacker to my existing rails app, everything is working like a charm. Webpack config is found under config/webpack/shared.js config/webpack/development.js config/webpack/production.js node_modules are installed in vendor/node_module...
more »

2017-02-10 17:02 (1) Answers