Monday, February 6, 2012

[Rails] How to Load Development environment in Rails

I am using rails 3 on ubuntu 10. When i trying to load rails
development environment using Rails Runner command

i am getting this:

Usage: runner [options] ('Some.ruby(code)' or a filename)

-e, --environment=name Specifies the environment for the
runner to operate under (test/development/production).
Default: development

-h, --help Show this help message.

You can also use runner as a shebang line for your scripts like this:
-------------------------------------------------------------
#!/usr/bin/env /root/workspace/anurag/script/rails runner

Product.all.each { |p| p.price *= 2 ; p.save! }
-------------------------------------------------------------

I also tried rails console command then i get this error:

usr/local/lib/ruby/1.9.1/irb/completion.rb:9:in `require': cannot load
such file -- readline (LoadError)
from /usr/local/lib/ruby/1.9.1/irb/completion.rb:9:in `<top
(required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.0/lib/
rails/
commands/console.rb:3:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.0/lib/
rails/
commands/console.rb:3:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.0/lib/
rails/
commands.rb:38:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.0/lib/
rails/
commands.rb:38:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

Anyone please tell how to load Development environment.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate