the interactive, command-line interface to the Ruby-based Rails framework. The Rails console allows developers to interact directly with their application without using a browser.
Questions tagged [rails-console]
441 questions
0
votes
1 answer
awesome_print integration with pry - getting dependencies.rb:247:in `require' error
I am trying to use awesome_print (1.2.0) with pry. Both gem awesome_print (1.2.0) and Pry version 0.10.1 is installed on Ruby 2.1.2.
Currently i am able to use run pry while running rails console, however i am not able to make awesome_print work…

rosnk
- 1,068
- 1
- 14
- 36
0
votes
2 answers
Exiting rails console with 'n'
I noticed a weird thing. I accidentally typed:
@a = n
which led to exit of rails console.
On further experimenting I found out even if I just do (in console)
n
The console exits. If I try any other character, I get error as expected.
a
# =>…

shivam
- 16,048
- 3
- 56
- 71
0
votes
1 answer
Ruby on Rails: Data not saving ActiveRecord
I'm pretty new to Ruby on Rails and I've been trying to develop a simple blog. However when I try to save the new Post, the page reloads a new page and no data is saved. The data however is present in the URI.
Here's my controller:
class…

DaneEH
- 35
- 6
0
votes
2 answers
If I require a file in application.rb does this make it available throughout the app?
Application.rb:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
require 'parse-ruby-client'
Parse.init :application_id => "",
:api_key => ""
# Require the gems listed in Gemfile, including any…

LondonGuy
- 10,778
- 11
- 79
- 151
0
votes
1 answer
prevent each from returning all the data in rails c
Many times in administering rails web applications, I find myself developing methods that I want to call from rails console since they are designed to solve specific problems and so they usually don't deserve a place in the administrative area.…

AgostinoX
- 7,477
- 20
- 77
- 137
0
votes
2 answers
how to access this info_config[:hash][key]
i have a file info.yml that has info like this
"email1@gmail.com":
ame: "Paul"
from: "VISA-PG-Credit Card Acquittal-"
project: "001-Admin"
entity: "01-HTW (Los Angeles)"
"email2@gmail.com"
name: "Bill"
from:…

user3691308
- 13
- 1
- 3
0
votes
1 answer
Rails Console: Project(Table doesn't exist?) - Sqlite3
I've encountered a problem. I recently cloned an application on github and tried to launch it using the Rails Console. When I typed in the name of one of the tables, I received this message.
Project
=> Project(Table doesn't exist)
Here is the…

George Lucas
- 197
- 1
- 8
0
votes
3 answers
How to access a relational table in rails console
How do I access the relational table UserRole of the database in the rails console?
Schema:
ActiveRecord::Schema.define(version: 20140709163149) do
create_table "users", force: true do |t|
t.string "stuff"
...
t.datetime…

chris Frisina
- 19,086
- 22
- 87
- 167
0
votes
2 answers
rails console error: 'load error' 'NoMethodError'
I installed rails, but when I try to run $rails console I get an error. Can anybody tell me what should I do?(I know similar questions have been asked before, but I still don't know what exactly should I do.) If that helps, I have ubuntu 13.10, ruby…

user3597446
- 29
- 5
0
votes
1 answer
raise_if_conflict error occurring when I try to run rails console
I am running windows with Ruby 1.9.3 with Rails 4.1.1 installed. In console, when I run rails c, it responds with:
'raise_if_conflicts': Unable to activate railties-4.1.1, \
because activesupport-2.3.8 conflicts with activesupport <= 4.1.1>,…

TaiwanTimmy
- 177
- 1
- 1
- 11
0
votes
1 answer
Rail 4 refuses save record to database - belongs_to
The Issue
The rails console will not save my record to the database if it has a belongs_to association.
2.1.1 :002 > Track.create name: 'asdfasdf'
(0.1ms) begin transaction
SQL (0.6ms) INSERT INTO "records" ("created_at", "updated_at") VALUES (?,…

colin
- 52
- 9
0
votes
2 answers
Configure rails console depending on environment
Is it possible to configure rails application to make rails console behave different in different environment? For example: on production i would like rails console to have one set of colours, but on localhost (development mode) a completely…

Leo
- 2,061
- 4
- 30
- 58
0
votes
1 answer
How do I access a helper in an engine from the Rails console?
How do I call a helper inside an engine from the Rails console? I…

Chloe
- 25,162
- 40
- 190
- 357
0
votes
2 answers
Ruby on Rails console, beginner error
In rails console when I want to add a column to my table with below command
2.1.1 :001 >post = Post.new( :title => "first post", :job => "first job”)
it gives me
2.1.1 :002">
2.1.1 :003">
2.1.1 :004">…

Amir Nabaei
- 1,582
- 1
- 15
- 26
0
votes
1 answer
Rails Error: `method_missing': undefined method `register_middleware'
On Rails, I'm trying to rake a new task I just created and it's giving me an undefined method error:
syck has been removed, psych is used instead
rake aborted!
NoMethodError: undefined method `register_middleware' for…

user3574752
- 1
- 1