4
votes

My configuration:

  • Operating System: Ubuntu 12.04
  • rvm version: 1.25.14
  • ruby version: 2.1.0p0
  • gem version: 2.2.1

    $ which ruby /home/tauhidul35/.rvm/rubies/ruby-2.1.0/bin/ruby $ which rvm /home/tauhidul35/.rvm/bin/rvm $ which gem /home/tauhidul35/.rvm/rubies/ruby-2.1.0/bin/gem $ which bundle /home/tauhidul35/.rvm/gems/ruby-2.1.0@global/bin/bundle

Now when I run command, I get error:

$ gem install rails
ERROR:  While executing gem ... (NoMethodError)
undefined method `ord' for nil:NilClass

If I run command, I get error:

$ sudo apt-get install rails
E: Unable to locate package rails

I am new in Ubuntu and also Ruby on Rails. Please help me.

2
please provide an output of the commands: which ruby, which rvm, which gem, which bundle.Малъ Скрылевъ
As your requirements I edit my question.Tauhidul Islam
It seems ok, please try to install fixed rails version: gem install rails v "4.0.2", or then gem install rails v "~> 3.0"Малъ Скрылевъ
Try gem update --systemOneChillDude
Sorry same error occurs. I think, the error occurs for gem. But I am not sure. Please try another solution. I also trying...Tauhidul Islam

2 Answers

2
votes

Thanks to all for your help.
At last this problem is solved, when I update my computer using Ubuntu Update Manager.
I don't know why solved the problem after updates. But I am sure it is solved by Updating all.

Specially thanks to majioa.

0
votes

Remember that you can also 'get certain' of your ruby and gem situation by installing a new ruby with a new gemset.

You can use rbenv to install a ruby and gemset to a local path over which you have full permission control, so that you can remove, reinstall, etc. them any time.

You can install a ruby manager like rbenv by following the instructions here