Questions tagged [ruby-on-rails-5.1]

For issues specific to the version 5.1 of Rails. If your question applies to Ruby on Rails in general, use the tag [ruby-on-rails].

Ruby on Rails 5.1, "an open-source web framework that's optimized for programmer happiness and sustainable productivity." Rails 5.1 brings a bunch of new features and improvements over older Rails versions.

Major Features

  • Yarn Support
  • Webpack
  • Encrypted secrets

See Ruby on Rails 5.1 Release Notes for more information.

Resources

Related tags

397 questions
4
votes
2 answers

Rails 5.1.1 not generating scaffold / controller etc

Updated local installation of rails from 5.0.1 to 5.1.1. last night. I'm now failing to get any generation to work i.e. rails g scaffold Product or rails generate controller Welcome. The terminal doesn't respond at all. I have to ctrl-c to break…
Simon Cooper
  • 1,574
  • 4
  • 24
  • 53
4
votes
1 answer

install with Yarn bootstrap@4.0.0-alpha.6 on rails 5.1

I'm following this tutorials for install Bootstrap with Yarn this was the command for the new version of Bootstrap 4 on rails 5.1 who watch here: yarn add bootstrap@4.0.0-alpha.6 So I notice it was installed the bootstrap 4 alpha 6, JQuery3 and…
rld
  • 2,603
  • 2
  • 25
  • 39
3
votes
2 answers

Rails 5.1 with ElasticSearch 7.1 reindex error

I am facing some issue while run this command on Rails 5 console. :017 > User.reindex I have some data in users table :012 > User.all User Load (10.3ms) SELECT "users".* FROM "users" LIMIT $1 [["LIMIT", 11]] => #
vipin
  • 2,374
  • 1
  • 19
  • 36
3
votes
2 answers

Having difficulties to add sqlite3 into gemfile

I am having difficulties to run rails server command because of the following error: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add gem 'sqlite3' to your Gemfile (and ensure its version is at the minimum required by…
Anton S.
  • 969
  • 1
  • 11
  • 29
3
votes
1 answer

jQuery conflict on Rails

My application.js: //= require rails-ujs //= require jquery //= require activestorage //= require turbolinks //= require bootstrap-sprockets //= require flatpickr.min //= require_tree . My Gemfile: gem 'sass-rails', '~> 5.0' gem 'uglifier', '>=…
fabdurso
  • 2,366
  • 5
  • 29
  • 55
3
votes
1 answer

Rails 5 - How to create custom scaffold generator?

The goal is for command... bin/rails generate custom_scaffold Thing ... to generate the following 6…
Jan Werkhoven
  • 2,656
  • 1
  • 22
  • 31
3
votes
4 answers

form_with does not hit the controller's action

I tried both form_tag and form_with - the result is the same, controller's action never gets triggered. # routes.rb resources :products do member do patch :add_comment end end # products_controller.rb def add_comment # !!! damn form_with…
Andrey Deineko
  • 51,333
  • 10
  • 112
  • 145
3
votes
2 answers

Disable IP address logging with devise

I'm currently in the process of removing IP logging from our app, I was wondering what's the best way to go about doing this with Devise?
Thermatix
  • 2,757
  • 21
  • 51
3
votes
0 answers

Rails 5.1 Moving js files from app/assets/javascripts to app/javascript

I was trying to move my JS files from app/assets/javascripts to app/javascript. Basically moving away from Asset Pipeline to Webpack. I am getting multiple errors on the process. 1. The only thing I did is moved the file and removed the precompile…
Sandip Subedi
  • 1,039
  • 1
  • 14
  • 34
3
votes
0 answers

Rails keeps erasing ar_internal_metadata table from the schema when running migration

Whenever I run a migration on my local machine, the rails internal table ar_internal_metadata is removed from the schema, I've run the command: bin/rails db:environment:set RAILS_ENV=development but it doesn't seem do anything. The table is…
3
votes
2 answers

Rails 5.1.5 upgrade causes - uninitialized constant Mime::JSON

Whenever a controller renders json I get, uninitialized constant Mime::JSON I have not modified any code related to this. Ex, the code for this controller method that throws the error: def names @families = Family.pluck(:name) render json:…
Chris Habgood
  • 400
  • 3
  • 11
3
votes
1 answer

Why 'ApplicationRecord.descendants.count' gives 1 even there are many descendants (inheriting models) of ApplicationRecord?

I ran following code in rails console: ApplicationRecord.descendants.count # 1 = this gave only 1 Even there are many child classes inheriting from "ApplicationRecord" class insde project_root/app/models/ in rails 5.1.3.
3
votes
2 answers

Ruby 2.4 Enumerable#sum breaks in Rails 5.1

In Rails 5.1.4 using Ruby 2.3.5, I get this behavior: >> [].sum #> nil I'd like to upgrade to Ruby 2.4, where Enumerable#sum is implemented natively. Testing this in IRB using Ruby 2.4.2, I get this result: >> [].sum #> 0 That's OK, and I can…
moveson
  • 5,103
  • 1
  • 15
  • 32
3
votes
1 answer

Rails 5.1 app does not seem to load Vue component CSS

I'm trying out a brand new Rails 5.1.4 app, installing both the default webpacker and vue scripts rails new app --webpack rails webpacker:install:vue I'm trying out the new app with the include hello_vue.js sample file. "Hello Vue!" gets rendered,…
Chih-Chao Lam
  • 514
  • 4
  • 15
3
votes
2 answers

Puma not working with Rails 5

I am upgrading my Rails app from 4.1.1 to 5.1.4. Previously it was using webrick in application server, but as Rails 5 is using Puma as default server so I installed it but getting error. config/puma.rb # Change to match your CPU core count workers…