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

Error when running rails command (server, generate model, console, generate controller)

Im running into a weird error whenever I invoke rails g model, or rails s. Application has been running fine and just noticed it now that I want to add a new Model. Here's the stack trace for running rails g model my_model name:string, rails c and…
scanales
  • 602
  • 1
  • 7
  • 18
0
votes
2 answers

Rubygems don't load in IRB or Rails Console

Using RVM on OSX, I'm trying to use ruby gems. However, a require 'rubygems' returns false in IRB and Rails console. Going through similar questions here, I figured it might have to do with the Gem path vs Gem env. MAC-AC028761:Ruby ac028761$…
absessive
  • 1,121
  • 5
  • 14
  • 36
0
votes
1 answer

difference between console email and rake email attachments

I'm generating an invoice pdf via wicket_pdf and this works. This pdf will be used as attachment in an email in a later step of process. # user.rb def send_last_invoice_email!(invoice) UserMailer.send_actual_invoice_email(self,…
guefi
  • 110
  • 1
  • 7
0
votes
2 answers

Rails console does not send any output to the development.log

I am using Rails 3.2.13 More specifically, whenever I do a item.destroy via the console....it doesn't send the output to my development.log. E.g.: > note = Item.last Item Load (31.0ms) SELECT "items".* FROM "items" ORDER BY "items"."id" DESC…
marcamillion
  • 32,933
  • 55
  • 189
  • 380
0
votes
1 answer

how to fix /.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 17, col 9: ` adapter: mysql2' (ArgumentError)

I'm trying to run the rails console on Appfog by following this document. I set up my database.yml as described, but when I run RAILS_ENV=proxied-appfog rails console I'm getting this error: /.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/yaml.rb:133:in…
GiH
  • 14,006
  • 13
  • 43
  • 56
0
votes
1 answer

I18n localize Activerecord Model value Date strftime On Rails console

So i'm using I18n Indonesia localize. I have a id.yml on config/locales. I want store value of created_at (datetime) to code (string) and Month translation to my locale before save.. self.code = account.created_at.strftime("%d%B%Y").to_s I'm…
0
votes
2 answers

"undefined local variable or method" in the rails console when it encounters methods provided by has_secure_password

My problem is when I try to use the rails console to update a user email I get NoMethodError: undefined method 'update_attribute' While working thru the problem I tried current_user = user.authrnticate(foobar) and got back NameError: undefined…
Kit
  • 113
  • 2
  • 10
0
votes
1 answer

Trouble accessing column value rails console

I'm trying to access the integer stored in a column called totalVotes in my UserVotes table but keep getting a No Method Error I have been trying to debug from the console: 1.9.3-p327 :006 > uservote = UserVote.where("soundcloud_id = 68061927") …
bsiddiqui
  • 1,886
  • 5
  • 25
  • 35
0
votes
1 answer

Command to open new console with ruby script after running selenium server

I am trying to run a script consisting of different commands which are : 1) system "bundle exec rails s -e test -d" 2) system "bundle exec selenium-rc" 3) system "bundle exec rspec test/selenium/*_sel.rb" now when line 1 executes server runs and…
0
votes
2 answers

Rails Console not loading? y (Errno::ENOENT)

I'm all of the sudden getting the follow error message when I try to load the rails console. I just recently switched databases to postgres, which has given me a slew of problems (although I must admit I like it a lot better than mysql!), so I'm…
cadlac
  • 2,802
  • 3
  • 18
  • 34
0
votes
1 answer

Rails console error - savon gem

i try this comand on rails console: client = Savon.client("http://www.webservicex.net/uszip.asmx?WSDL") but this erros appears: TypeError: can't convert String into Hash and i already have add 'savon' gem to my gemfile and the version of savon is…
0
votes
2 answers

Updating single ActiveRecord object, console output seems problematic

I'm trying to implement a button to update a single attribute (setting an "Active" boolean value to true) for records. After digging around online, I found the following code to 'solve' the problem: button_to "Add", movie_path(m, active: true),…
Brad Rice
  • 1,334
  • 2
  • 17
  • 36
0
votes
1 answer

What's the difference between using a delayed_job and running rails console

I need to get a long running crawling task done on the server side, so I have tried to use a delayed_job for it, however, I've ran into problem while using the delayed_job with Capybara. So, I run the task in rails console instead. Since it is a…
I'm a frog dragon
  • 7,865
  • 7
  • 46
  • 49
0
votes
1 answer

How to paginate awesome_print results inside pry

I'm using awesome_print gem to display output from pry to look pretty. Since, awesome_print uses line breaks, long outputs like ap html.chapters.order("position ASC") only shows the end part of the output, How Do I paginate the result to look like…
Sathish Manohar
  • 5,859
  • 10
  • 37
  • 47
0
votes
1 answer

How I can see all the queries executed and classes or methods in my gemfile?

I´m newbie in RoR and I would like to know how I can do two things in Rails (both versions 2 and 3): How I can see all queries generated to database (save, update, find, etc.) in the console of the server? How I can see all the classes and methods…
Julieta
  • 81
  • 2
  • 10