Rails Console vs. Command Line

Hello Everyone,
  I am having a litle difficulty using the rails console.  For instance, when I run this command "bundle exec rake db:migrate" in the command line (Ubuntu) it works.  However, when I run it in the rails console on Rubymine, I get this.

>> rake db:migrate
NameError: undefined local variable or method `migrate' for main:Object
    from (irb):1
    from /home/dallas/RubymineProjects/Hoitomt/rake/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands/console.rb:45:in `start'
    from /home/dallas/RubymineProjects/Hoitomt/rake/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands/console.rb:8:in `start'
    from /home/dallas/RubymineProjects/Hoitomt/rake/ruby/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:40:in `<top (required)>'
    from /home/dallas/RubymineProjects/Hoitomt/script/rails:6:in `require'
    from /home/dallas/RubymineProjects/Hoitomt/script/rails:6:in `<top (required)>'
    from -e:1:in `load'
    from -e:1:in `<main>'

Does anyone have a clue as to what I am doing wrong ?  My enviroment is set to develop, and I am working with the tutorial found here http://mikehoitomt.wordpress.com/2011/03/10/sencha-touch-application-with-ruby-on-rails-part-1/

Any help is greatly appreciated.

Comment actions Permalink


Rails console is intended to run ruby code in loaded Rails environment. It's not intended to run terminal commands. If you want to run rake task you need to use Tools | Run rake task

Comment actions Permalink

Thanks alot Dennis. Sigh, looks like I have alot to learn in this new Ruby on Rails world.


Please sign in to leave a comment.