Questions tagged as 'ruby'

0
answers

Problem with rails command db: create undefined symbol: rb_enc_alias

When I create a project (from scratch) I then give the comado rails db: create to create the database and I get this error: LoadError: /var/lib/gems/2.3.0/gems/pg-1.1.0/lib/pg_ext.so: undefined symbol: rb_enc_alias - /var/lib/gems/2.3.0/gems/...
asked by 27.08.2018 / 23:00
2
answers

How to put the average in the last table in Rails

I have the following question:
asked by 08.06.2018 / 07:11
1
answer

Rails inheritance

I'm starting in the area, I have the following scenario in my back end done in rails: I want to implement a parent class: Equipment: ID PK Brand ... And some child classes Printer: ID_EQUIPMENT PK and FK ... Computers: ID_EQUIPMENT P...
asked by 18.05.2018 / 20:53
1
answer

Rails CanCanCan - Questions about Roles table

Good afternoon, I have the following models: User.rb class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable,...
asked by 18.05.2018 / 20:41
1
answer

Ruby on Rails SQLite3 :: BusyException: database is locked: INSERT INTO

Hello, I'm facing a problem with SQLite3. When I run the code: user = SystemUser.new(email: "[email protected]", password: "marcos123") user.profile = Profile.new(first_name: "Marcos") user.save Rails runs in SQLite: (0.1ms) begin trans...
asked by 13.11.2017 / 00:33
1
answer

How to change the values of a hash?

I need a loop to change the values of this object { [ "Begin", "Dom" ] => 0, [ "Begin", "Seg" ] => 8, [ "Begin", "Ter" ] => 10, [ "Begin", "Qua" ] => 30, [ "Begin", "Qui" ] => 20, [ "Begin", "Sex" ] =>...
asked by 04.12.2017 / 22:01
1
answer

Undefined method in Ruby

I'm trying to make a relationship between two tables in Ruby, where I use the student and notes but when I go into localhost: 3000 / students / 1 / notes it gives me the error
asked by 10.11.2017 / 16:10
0
answers

"\ xED" followed by "t" on UTF-8

I have a rails application and when I run or compile the assets it gives the following error: "\ xED" followed by "t" on UTF-8 In my    application.rb I already have this key: config.encoding = "utf-8" Does anyone know what it c...
asked by 21.11.2017 / 18:13
1
answer

RSpec - Testing feature failing because elements are not rendered in test execution

I have a test feature that fails because at the time it runs some HTML elements ( <li data-podcast> ) have not yet been rendered. Does anyone know how I can fix this? RSpec.describe 'Podcasts List', type: :feature do scenario...
asked by 05.08.2017 / 03:31
1
answer

Retrieve field with join in view in RUBY / RoR

I have a big question, I am a beginner in Ruby, and I am not able to print the value of a field in my view, the result is that. My Model: class Pedido < ActiveRecord::Base has_many :produtos scope :waiting, -...
asked by 23.08.2017 / 19:47