installing rails with gem , error loading command : install undefined method 'invoke_with_build_args`

半腔热情 提交于 2019-12-08 16:45:28

问题


I'm try to install rails on Debian. when run this command

gem install rails

I gave this error:

ERROR:  Loading command: install (LoadError)
    cannot load such file -- zlib
ERROR:  While executing gem ... (NoMethodError)
    undefined method ``invoke_with_build_args' for nil:NilClass

even when I try this command: gem install I gave this error:

ERROR:  Loading command: install (LoadError)
    cannot load such file -- zlib
ERROR:  While executing gem ... (NoMethodError)
    undefined method ``invoke_with_build_args' for nil:NilClass

I used this link to build ruby from sources ruby 2.1.2 build instruction

what can I do to overcome this error?


回答1:


For who compile from source, they must checked dependencies. I think you need to install this library :

sudo apt-get install libssl-dev

Then you must recompiled ruby and everything worked.




回答2:


You need to install the zlib development headers.

Refer to your OS's package manager instructions on how to do this.

On a RedHat derivative it would look something like this:

sudo yum install zlib-devel

For ubuntu:

sudo apt-get install zlib1g-dev

Hope this helps



来源:https://stackoverflow.com/questions/26947586/installing-rails-with-gem-error-loading-command-install-undefined-method-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!