问题
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.
回答1:
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.
回答2:
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
来源:https://stackoverflow.com/questions/21097255/error-when-run-gem-install-rails