Installation of gem rails, error loading command: set the undefined method 'invoke_with_build_args`

I am trying to install rails on Debian. when running 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 create ruby ​​from sources Ruby 2.1.2 build instruction

What can I do to overcome this error?

+8
linux ruby ruby-on-rails gem debian-based
source share
2 answers

To compile from source, they must check dependencies. I think you need to install this library:

 sudo apt-get install libssl-dev 

Then you have to recompile ruby ​​and everything works.

+17
source share

You need to set the zlib headers.

Refer to the OS package manager instructions on how to do this.

On a RedHat derivative, it will look something like this:

 sudo yum install zlib-devel 

For ubuntu:

 sudo apt-get install zlib1g-dev 

Hope this helps

+3
source share

All Articles