1

I am new to rails and when i tried to run rails console from my root it is giving below error...

harsha@Trebuchet:~/simp_cms$ rails console
/home/harsha/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/app_rails_loader.rb:39: warning: Insecure world writable dir /usr in PATH, mode 040777
/home/harsha/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.5/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /usr in PATH, mode 040777
/home/harsha/.rbenv/versions/2.2.2/lib/ruby/2.2.0/irb/completion.rb:9:in `require': cannot load such file -- readline (LoadError)
    from /home/harsha/.rbenv/versions/2.2.2/lib/ruby/2.2.0/irb/completion.rb:9:in `<top (required)>'
    from /home/harsha/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/console.rb:3:in `require'
    from /home/harsha/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/console.rb:3:in `<top (required)>'
    from /home/harsha/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:123:in `require'
    from /home/harsha/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:123:in `require_command!'
    from /home/harsha/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:58:in `console'
    from /home/harsha/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /home/harsha/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>' 

My ruby & ROR version details are mentioned below

harsha@Trebuchet:~/simp_cms$ ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
harsha@Trebuchet:~/simp_cms$ rails --version
/home/harsha/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/app_rails_loader.rb:39: warning: Insecure world writable dir /usr in PATH, mode 040777
/home/harsha/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.5/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /usr in PATH, mode 040777
Rails 4.2.2
harsha@Trebuchet:~/simp_cms$ gem list

*** LOCAL GEMS ***

actionmailer (4.2.2)
actionpack (4.2.2)
actionview (4.2.2)
activejob (4.2.2)
activemodel (4.2.2)
activerecord (4.2.2)
activesupport (4.2.2)
arel (6.0.0)
bigdecimal (1.2.7, 1.2.6)
binding_of_caller (0.7.2)
builder (3.2.2)
bundler (1.10.5)
columnize (0.9.0)
debug_inspector (0.0.2)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.3.8)
erubis (2.7.0)
globalid (0.3.5)
i18n (0.7.0)
io-console (0.4.3)
json (1.8.3, 1.8.1)
loofah (2.0.2)
mail (2.6.3)
mime-types (2.6.1)
mini_portile (0.6.2)
minitest (5.7.0, 5.4.3)
mysql2 (0.3.18)
nokogiri (1.6.6.2)
power_assert (0.2.3, 0.2.2)
psych (2.0.13, 2.0.8)
rack (1.6.4)
rack-test (0.6.3)
rails (4.2.2)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.6)
rails-html-sanitizer (1.0.2)
railties (4.2.2)
rake (10.4.2)
rdoc (4.2.0)
sdoc (0.4.1)
spring (1.3.6)
sprockets (3.2.0)
sprockets-rails (2.3.2)
test-unit (3.1.2, 3.0.8)
thor (0.19.1)
thread_safe (0.3.5)
tzinfo (1.2.2)
web-console (2.1.3)
harsha@Trebuchet:~/simp_cms$ 

Please suggest me what i eed to do to get rid of this error?

1 Answer 1

7

You're running a version of ruby with no Readline support Please gem install rb-readline or recompile ruby --with-readline. So after installing it with gem install rb-readline and confirming the installation was sucessful with:

Add gem 'rb-readline' to your Gemfile and it should work.

Sign up to request clarification or add additional context in comments.

1 Comment

I just edited the answer, @AkshayChavan actually answered the question. And you can accept the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.