Questions tagged [rails-console]

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.

441 questions
0
votes
1 answer

Rails Console not starting up

I am trying to run rails console rails c in ConEmu and Cmder but get the following error.... C:/Ruby21-x64/lib/ruby/2.1.0/open-uri.rb:30:in `initialize': No such file or directory @ rb_sysopen -…
mikeymurph77
  • 752
  • 1
  • 11
  • 28
0
votes
0 answers

NameError: uninitialized constant ""

I am following the tutorial on Lynda on Ruby on rails 4. I have having multiple issues: I am getting the security issue which I don't know how to remove it I keep getting NameError when I am creating anything new. I am stuck, any help would much…
0
votes
1 answer

How to assign Subcategory to Category in Rails 4

When i want to add new Categories i fire up rails console and type Category.create(name: "Programming and Tech") When i want to add new Subcategories i type in rails console Subcategory.create(name: "Rails,Wordpress,php,Ruby...etc") #those are…
0
votes
1 answer

What are the extra line items in rails console when entering an invalid command?

Specifically, I see: Loading development environment (Rails 4.2.1) irb(main):001:0> f NameError: undefined local variable or method `f' for main:Object from (irb):1 from…
Ben
  • 71
  • 1
  • 9
0
votes
1 answer

Cant make my rails console work

eze@eze:~/Appp$ rbenv local rbenv: no local version configured for this directory eze@eze:~/Appp$ rbenv global 2.2.1 eze@eze:~/Appp$ rbenv versions * 2.2.1 (set by /home/eze/.rbenv/version) I recently uninstalled and reinstalled ruby with rbenv,…
xeitor
  • 368
  • 4
  • 15
0
votes
1 answer

Can't generate migration in rails console

For some reason I am suddenly unable to generate a migration from my rails console and am unsure how to interpret the error. I believe it has to do with a problem from when I tried to remove refinery cms early on. Here is an example of the…
b1akely
  • 37
  • 1
  • 7
0
votes
1 answer

rails console works but rails server not working

Hi I'm running into an issue which is not making sense to me. On my hosting server I have a rails app which I want to run. I can deploy the app fine using capistrano. I am also able to run bundle exec rails console production without any problems.…
Ameya Savale
  • 431
  • 1
  • 8
  • 21
0
votes
2 answers

rails console rollback on save

I am a new to rails. I am working with rails 4.2 and I broke something in my user.rb model or controller so that I can't use save or update in console or in in the web browser(for some varibles in user, I can change the name, email, and password in…
NAthan Davis
  • 5
  • 1
  • 3
0
votes
1 answer

Is there a Cuba equivalent of the Rails Console?

I'd like to be able to test classes that I require in Cuba without having to require them each individually using the irb. What I've been using instead is an endpoint that runs binding.pry, but I'd much rather be able to use something like the Rails…
Tom Prats
  • 7,364
  • 9
  • 47
  • 77
0
votes
1 answer

undefined method `<<' for nil:NilClass rails console

Hey i'm creating database schema and test it in rails console. I have relation User has_many :rates and Rates belongs_to :user. When I type in rails console: user = User.find(1) rate = Rate.find(1) user.rates << rate Every thing works fine, but…
mkkrolik
  • 1,200
  • 14
  • 21
0
votes
2 answers

Rails Console prevent assignment output to terminal

I have 500+ strings in a file. If I simply copy-paste it into Rails console to assign the values to an array, it takes a lot of time(10 mins+) and the CPU usage spikes to maximum (the fans go crazy in my laptop) just to print whatever I have pasted.…
tekina
  • 571
  • 10
  • 21
0
votes
1 answer

How to start the rails console on Heroku with a multi-buildpack?

I'm deploying to heroku with the multi-buildpack on the cedar stack using a custom procfile: web: bundle exec unicorn -p $PORT -E $RACK_ENV -c ./config/unicorn.rb worker: bundle exec sidekiq -e production -C config/sidekiq.yml console: bundle exec…
RSG
  • 7,013
  • 6
  • 36
  • 51
0
votes
0 answers

Map does not show up gmap4rails with rails 4 + mogoid when the app is created by command Rails new -OJ

I am trying to use gmaps4rails gem to implement google map to create polygon. I am using Rails 4 with Mongodb (Mongoid). Where I am using geospatial queries to get my results and later I will be showing a set of cordinates as polygon on gmap. I…
0
votes
2 answers

Selecting all current attributes of a model for validations in Rails

When setting up my models I often find myself having to write out all of its attributes when setting up certain validations. A common example is when I use the presence parameter: validates :first_name, :last_name, :username, :email, presence:…
Carl Edwards
  • 13,826
  • 11
  • 57
  • 119
0
votes
2 answers

Make request from rails console return 302

In Rails 4.0.3, I try to send a http get request from rails console: app.get '/' it returns with response code 302 redirected. Started GET "/" for 127.0.0.1 at 2014-09-03 11:57:11 +0200 => 302 However, this page is a public page, shouldn't be…
fuyi
  • 2,573
  • 4
  • 23
  • 46