Ruby on Rails 6 is the latest version of Ruby on Rails, "an open-source web framework that's optimized for programmer happiness and sustainable productivity."
Questions tagged [ruby-on-rails-6]
2084 questions
98
votes
13 answers
Upgraded Rails to 6, getting Blocked host Error
I needed the new function in ActiveStorage to resize_to_fill so I upgraded to Ruby 2.5.1 and Rails 6.
ruby '2.5.1'
gem "rails", github: "rails/rails"
When I stopped, then restarted my server (Cloud 9), I received the below Rails error:
Blocked…

Tony S.
- 1,161
- 1
- 9
- 13
91
votes
3 answers
Your bundle is locked to mimemagic (0.3.5), but that version could not be found in any of the sources listed in your Gemfile
Today I tried to build a docker for my rails 6.1.0 with active storage, I got the following error:
Your bundle is locked to mimemagic (0.3.5), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed…

channa ly
- 9,479
- 14
- 53
- 86
79
votes
2 answers
What is the use of secret_key_base in rails 4
I am new to Rails 4, and do not understand the use of secret_key_base under config/secrets.yml in Rails 4. Can you please explain this concept?
Also, when I am working in the production environment, I am prompted to set the secret_key with…

Mani David
- 1,382
- 1
- 14
- 30
66
votes
3 answers
How to fix Rails's warning messages with Ruby 2.7.0
Did anyone resolve this issue with Ruby 2.7.0?
I used rbenv and installed Ruby v2.7.0 and then created a Rails project using Rails v6.0.2.1.
Currently, by running one of
rails s
rails s -u puma
rails s -u webrick
the server is up and the site is…

Nezir
- 6,727
- 12
- 54
- 78
47
votes
20 answers
Webpacker can't find application
I'm creating a new rails application according to "Getting Started with Rails". The application starts normally in step 4.1. But when i create my first controller, i have a webpack error.
I'm new in webpack, i have red all documentation, but i don't…

Robin Des Bois
- 571
- 1
- 4
- 6
44
votes
6 answers
Relation passed to #or must be structurally compatible. Incompatible values: [:references]
I have two queries, I need an or between them, i.e. I want results that are returned by either the first or the second query.
First query is a simple where() which gets all available items.
@items = @items.where(available: true)
Second includes a…

frostbite
- 648
- 2
- 6
- 11
38
votes
4 answers
unknown attribute 'service_name' for ActiveStorage::Blob
After I upgraded from Rails 5 to 6.1, the ActiveStorage raises an error:
unknown attribute 'service_name' for ActiveStorage::Blob.
Why, and how can I fix it?

Pringles
- 421
- 6
- 9
36
votes
8 answers
Warning: the running version of Bundler is older than the version that created the lockfile error
When I'm developing/testing, I'm keep getting this error in my console
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by…

Semih Arslanoglu
- 1,069
- 5
- 20
- 23
32
votes
1 answer
PG::UndefinedTable: ERROR: relation "active_storage_blobs" does not exist
Updated app Rails 5.2 to 6, the following two migrations were added by the update:
# This migration comes from active_storage (originally 20190112182829)
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
def up
…

wachichornia
- 1,178
- 14
- 31
31
votes
2 answers
Is the 'Travel' time helper not available in feature specs?
I just tried to use Rails' time helper method travel in one of my feature specs:
scenario 'published_at allows to set a publishing date in the future' do
magazine_article.update_attribute(:published_at, Time.now + 1.day)
expect { visit…

Flip
- 6,233
- 7
- 46
- 75
28
votes
5 answers
Using Rails 6, where do you put your “page specific” JavaScript code?
My question here is the same as Using Rails 3.1, where do you put your "page specific" JavaScript code?, just for Rails 6 instead of Rails 3.1.
Suppose I have some JavaScript that I want to use for my posts index page. Where do I put that file, and…

Adam Zerner
- 17,797
- 15
- 90
- 156
27
votes
8 answers
Rails: Vanilla Rails 6.0 error Command "webpack" not found
System:
Ruby: 2.6.3p62 (rvm)
Rails: 6.0
OS: macOS 10.14.6
Setup
A fresh Rails 6.0 application:
$ rails new testshop2
$ cd testshop2
$ rails g controller Page index
$ rails s
=> Booting Puma
=> Rails 6.0.0 application starting in development
=> Run…

wintermeyer
- 8,178
- 8
- 39
- 85
27
votes
3 answers
How to require custom JS files in Rails 6
I'm currently trying Rails 6.0.0.rc1 which seems to have moved the default javascript folder from app/assets/javascript to app/javascript. The application.js file is now located in app/javascript/packs. Now, I want to add a couple of js files, but…

Severin
- 8,508
- 14
- 68
- 117
26
votes
5 answers
ActiveAdmin actions
is there a way to specify in ActiveAdmin's index page of a model what actions are allowed, things like:
index do
actions :edit
end
index do
actions only: :edit
end
do not work. What's the correct syntax?
Appreciated.
bundle show…

muichkine
- 2,890
- 2
- 26
- 36
23
votes
6 answers
$ is not defined when installing jQuery in Rails via Webpack
I'm trying to install jQuery in Rails 6.0.0.rc1 via Webpack and I'm not sure what I'm missing but I'm getting the error $ is not defined in the browser console despite being able to compile jQuery.
I've added jQuery with yarn add jquery, so my…

alopez02
- 1,524
- 2
- 17
- 36