Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gem install rails output error in ubuntu

I'm new to this environment and I'm trying to install rails. I installed ruby and checked using rvm list I get ruby-2.0.0-p0 as my current and default. I tried to install rails after installing ruby

gem install rails

getting errors:

ERROR: Loading command :install (LoadError)
       cannot load such file -- openssl
ERROR: while executing gem ... (NoMethodError)
       undefined method `invoke_with_build_args` for nil:NilClass
like image 998
hellomello Avatar asked Dec 12 '22 17:12

hellomello


1 Answers

You are missing openssl there :)

Install the openssl package

rvm pkg install openssl

Remove the Ruby installation you're using

rvm remove 2.0.0

And finally recompile Ruby with openssl

rvm install 2.0.0 --with-openssl-dir=$HOME/.rvm/usr

Everything should be working now. Don't forget to:

rvm use 2.0.0 --default
like image 182
rorra Avatar answered Dec 14 '22 06:12

rorra