Search code examples
ruby-on-railslinuxubuntuterminalrbenv

Geting error in Terminal after trying Rails server


I'm trying to run server in Ubuntu Terminal by "$rails server", and i get this error in terminal:

" /home/sergei/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in require': cannot load such file -- rails/cli (LoadError) from /home/sergei/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:inrequire' from /usr/bin/rails:7:in `' ".

Ruby and Rails installed. Who knows how I can resolve that? Thanks!


Solution

  • Check if you have two ruby versions. Please paste the output of following command:

    $ which -a ruby
    

    If you more than one than leave one and remove others.

    1. Remove ruby version installed via ports (yum or whatever package manager).
    2. Remove ruby version that came with OS (hardcore rm by hand).
    3. Install ruby version from ports with different prefix (/usr instead of /usr/local)
    4. Reinstall rubygems