I am on ubuntu 12.04.5 LTS and tried installing ruby with jemalloc. The jemalloc got installed successfully(https://blog.scalingo.com/2017/05/02/improve-ruby-application-memory-jemalloc.html) but while installing the ruby 2.3.4, it gave this following error.
>rvm install 2.3.4 -C --with-jemalloc
Warning, new version of rvm available '1.29.1', you are using older version '1.27.0'.
You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
ruby-2.3.4 - #removing src/ruby-2.3.4..
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /home/deploy/.rvm/rubies/ruby-2.3.4, this may take a while depending on your cpu(s)...
ruby-2.3.4 - #downloading ruby-2.3.4, this may take a while depending on your connection...
ruby-2.3.4 - #extracting ruby-2.3.4 to /home/deploy/.rvm/src/ruby-2.3.4....
ruby-2.3.4 - #configuring...........................................................
ruby-2.3.4 - #post-configuration..
ruby-2.3.4 - #compiling.....
Error running '__rvm_make -j2',
showing last 15 lines of /home/deploy/.rvm/log/1494486344_ruby-2.3.4/make.log
compiling enumerator.c
compiling error.c
compiling eval.c
eval.c: In function 'rb_raise_jump':
eval.c:763:8: warning: unused variable 'mid' [-Wunused-variable]
compiling load.c
compiling proc.c
compiling file.c
compiling gc.c
In file included from gc.c:50:0:
/usr/include/malloc.h:152:15: error: conflicting types for 'malloc_usable_size'
/usr/include/jemalloc/jemalloc.h:45:8: note: previous declaration of 'malloc_usable_size' was here
make: *** [gc.o] Error 1
make: *** Waiting for unfinished jobs....
++ return 2
There has been an error while running make. Halting the installation.
Has anyone encountered it before or may have the experience with it, please help.
On [xK]ubuntu 18.10
I did
sudo apt install libjemalloc-dev
rvm install 2.5.2 -C --with-jemalloc
rvm use 2.5.2
ruby -r rbconfig -e "puts RbConfig::CONFIG['LIBS']"
I use Ubuntu 18.04.
Change the command like this
RUBY_EXTRA_CONFIGURE_OPTIONS="--with-jemalloc" rvm install 2.3.4 --disable-binary
To check the jemalloc is installed, run the following command:
ruby -r rbconfig -e "puts RbConfig::CONFIG['LIBS']"
if the ruby is unrecognized after rvm is installed.
source ~/.rvm/scripts/rvm
When the jemalloc is called. You can see the response.
-lpthread -ljemalloc -ldl -lobjc
You can see the full documentation here
I ran across a variant of this issue when trying to get rails to use jemalloc. In my case I had (purposefully) installed system-wide rubies via rvm but forgotten to use rvmsudo like so:
$ sudo apt update; sudo apt install libjemalloc-dev -y
$ rvmsudo rvm reinstall 2.4.1 -C --with-jemalloc
If you're getting permissions warnings when trying to get jemalloc to work in an analogous scenario, give ^^^ a shot...
Related
I'm getting an error while trying to install 2.3 ruby on osx
I've updated rvm to stable 1.27.0
then I'm trying to install 2.3
% rvm install 2.3
ruby-2.3.0 - #removing src/ruby-2.3.0 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-2.3.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/password123/.rvm/rubies/ruby-2.3.0, this may take a while depending on your cpu(s)...
ruby-2.3.0 - #downloading ruby-2.3.0, this may take a while depending on your connection...
ruby-2.3.0 - #extracting ruby-2.3.0 to /Users/password123/.rvm/src/ruby-2.3.0 - please wait
ruby-2.3.0 - #configuring - please wait
ruby-2.3.0 - #post-configuration - please wait
ruby-2.3.0 - #compiling - please wait
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/password123/.rvm/log/1460728216_ruby-2.3.0/make.log
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ossl_ssl.c:18:35: note: expanded from macro 'numberof'
#define numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0]))
^~~~~
ossl_ssl.c:2266:21: error: invalid application of 'sizeof' to an incomplete type 'const struct (anonymous struct at ossl_ssl.c:85:14) []'
for (i = 0; i < numberof(ossl_ssl_method_tab); i++) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ossl_ssl.c:18:35: note: expanded from macro 'numberof'
#define numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0]))
^~~~~
4 warnings and 10 errors generated.
make[2]: *** [ossl_ssl.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2
+__rvm_make:0> return 2
There has been an error while running make. Halting the installation.
Could you advise me any steps to fix this error ?
Based on this rbenv discussion, I was able to work around this by uninstalling, reinstalling, and force-linking Homebrew OpenSSL:
brew uninstall --force openssl
brew install openssl
brew link --overwrite openssl --force
rvm install 2.3.0
I'd feel better if I knew what side effects the brew link might have, but it worked.
It worked for me:
Restart osx, then
brew uninstall openssl
brew unlink openssl098
brew install openssl
brew link --overwrite --force openssl
rvm install 2.3.0 # (or rvm install 2.3.1)
Based on https://github.com/rvm/rvm/issues/3656
Still getting the same error after running the lines mentionned,
Finally I solved my problem by updating hombrew, then uninstall and install openssl, then rvm install ruby 2.3 again
There are issues installing ruby <=2.3.0 compatibility with Openssl#1.1.
This worked for me
rvm install 2.3.0 --with-openssl-lib=/opt/local/lib/openssl --with-openssl-include=/opt/local/include/openssl
OpenSSL 1.1 isn’t compatible with Ruby 2.3.x checkout this issue here
I solved the issue on mac by using following command.
rvm reinstall ruby-2.3.8 --with-openssl-dir=`brew --prefix openssl#1.0` --debug
If you want more insights on the issue you can refer to this article https://mentalized.net/journal/2019/09/13/ruby-2-3-rvm-and-openssl-1-0/
When I try to install compass using sudo gem install compass it show me this :
Building native extensions. This could take a while...
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -r ./siteconf20141125-86718-gjziv3-0.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... no
checking for rb_thread_call_without_gvl()... no
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile
make clean
make
mkdir -p "/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c"/libffi-i386; (if [ ! -f "/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c"/libffi-i386/Makefile ]; then echo "Configuring libffi for i386"; cd "/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c"/libffi-i386 && env CC=" xcrun cc" CFLAGS="-arch i386 " LDFLAGS="-arch i386" "/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --host=i386-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 make -C "/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c"/libffi-i386
Configuring libffi for i386
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
configure: error: in `/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c/libffi-i386':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** No targets specified and no makefile found. Stop.
make: *** ["/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c"/libffi-i386/.libs/libffi_convenience.a] Error 2
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/ffi-1.9.6 for inspection.
Results logged to /Library/Ruby/Gems/1.8/extensions/universal-darwin-11/1.8/ffi-1.9.6/gem_make.out
I have correctly install sass and xcode' tools but nothing change. I even try to upgrade ruby. What should I do?
It happens because you want to sudo install and probably environment variables are not configured to use your installed ruby, instead it uses the system ruby which probably is not what you want to use.
The easiest way to use Ruby on Mac is to install rbenv and ruby-build using homebrew.
To install homebrew just run this command which can be found on brew homepage:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
To install rbenv and ruby-build you can run these commands which can be found on Github:
brew update
brew install rbenv ruby-build
Forgot to add that for sure, then you need to install a ruby version using rbenv and make it global.
rbenv install 2.1.5
rbenv global 2.1.5
And finally:
gem install compass
Just make sure that gem binary points to the version you've installed.
You can run gem env and checkout printed paths, if it doesn't point to newly installed ruby gem path, close the terminal and open a new one then install the gem.
Here is the first few lines of what's printed out on my machine:
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.0
- RUBY VERSION: 2.1.0 (2013-12-25 patchlevel 0) [x86_64-darwin13.0]
- INSTALLATION DIRECTORY: /Users/jani/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0
....
Trying to install stable version of Jekyll on OSX Mavericks. I have Xcode and the command line tools installed, yet I get this error:
sudo gem install jekyll
Password:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling porter.c
porter.c:359:27: warning: '&&' within '||' [-Wlogical-op-parentheses]
if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
~~ ~~~~~~~^~~~~~~~~~~~~~~~~~~~
porter.c:359:27: note: place parentheses around the '&&' expression to silence this warning
if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
^
( )
1 warning generated.
compiling porter_wrap.c
linking shared-object stemmer.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [stemmer.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/fast-stemmer-1.0.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/fast-stemmer-1.0.2/gem_make.out
Your problem appeared with Xcode 5.1. In order to avoid many problems related to MacOS' ruby version (this one and many others), you really should use RVM.
If you don't already have it, install Homebrew first: (it is not absolutely necessary, but allows us to install ruby and its dependencies without a looong compilation)
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Then, the following command will install RVM and the last version of Ruby:
\curl -L https://get.rvm.io | bash -s stable --ruby
Check everything is OK:
ruby --version
You can now install Jekyll:
gem install jekyll
Now, if you really don't want to use RVM, you can execute:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install jekyll
But I bet further problems would come.
You should definitely use RVM. Here are the steps:
Uninstall any existing XCode by deleting XCode from Applications folder.
Install Homebrew.
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Follow additional instructions listed in Homebrew install.
brew doctor
Install RVM.
\curl -L https://get.rvm.io | bash -s stable --ruby
Follow additional instructions upon RVM installation.
source ~/.rvm/scripts/rvm
Install jekyll.
gem install jekyll
Test jekyll.
$ jekyll serve
Configuration file: none
Source: /private/var/log
Destination: /private/var/log/_site
Generating... done.
Server address: ...
Server running... press ctrl-c to stop.
1) xcode-select --install
2) brew install ruby
3) sudo gem install jekyll
4) sudo gem install jekyll-import
RVM is installed and running. I am trying to install Ruby 2.0, but this happens with any version I try to install. This is a fresh install of rvm without ruby. I am running Debian Squeeze.
After running
rvm install 2.0
I get this error:
Installing Ruby from source to: /home/user/.rvm/rubies/ruby-2.0.0-p0, this may take a while depending on your cpu(s)...
ruby-2.0.0-p0 - #downloading ruby-2.0.0-p0, this may take a while depending on your connection...
ruby-2.0.0-p0 - #extracted to /home/user/.rvm/src/ruby-2.0.0-p0 (already extracted)
ruby-2.0.0-p0 - #configuring...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Error running './configure --prefix=/home/user/.rvm/rubies/ruby-2.0.0-p0 --disable-install-doc --enable-shared',
please read /home/user/.rvm/log/ruby-2.0.0-p0/configure.log
There has been an error while running configure. Halting the installation.
I see this error when I read /home/user/.rvm/log/ruby-2.0.0-p0/configure.log
checking if make is GNU make... ./configure: line 18790: make: command
not found no checking for safe null command for make... configure:
error: no candidate for safe null command
I then run:
rvm install 2.0.0 --autolibs=4 --debug
Then I get this error
ruby-2.0.0-p0 - #configuring... Error running './configure
--prefix=/home/user/.rvm/rubies/ruby-2.0.0-p0 --disable-install-doc --enable-shared', please read /home/user/.rvm/log/ruby-2.0.0-p0/configure.log There has been an error while running configure. Halting the installation.
__rvm_rm_rf already gone: /home/user/.rvm/tmp/26623*
I am not sure what to do after this point
Generally for certain gems you will probably also need
apt-get install build-essential
I can't get rvm to install Ruby 1.9.3; it keeps on asking for the Homebrew library 'libksba' even though it is already downloaded and installed. When I run the 'brew list' command it shows clearly.
I also have Xcode 4.5 installed.
Is this an environmental variables configuration issue, and I need to configure the path so that they can see each other? If it is, how do I configure it?
How do Homebrew and rvm work together? I'm not clear about this.
Thank you.
rvm install 1.9.3
Ruby (and needed base gems) for your selection will be installed shortly.
Before it happens, please read and execute the instructions below.
Please use a separate terminal to execute any additional commands.
Notes for Mac OS X 10.8.2, Xcode 4.5.2.
For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26"
For IronRuby: Install Mono >= 2.6
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba'
For Opal: Install Nodejs with NPM. See http://nodejs.org/download/
To use an RVM installed Ruby as default, instead of the system ruby:
rvm install 1.8.7 # installs patch 357: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems
rvm alias create default 1.8.7
And reopen your terminal windows.
Xcode and gcc:
:
'brew list' command output
brew list
apple-gcc42 automake libgpg-error libxml2
autoconf git libksba libxslt
Most recent session:
brew upgrade libksba
Error: libksba-1.2.0 already installed
$ brew update
Updated Homebrew from 5909e2c6 to 0e0ef31f.
==> New Formulae
globus-toolkit postgres-xc
==> Updated Formulae
casperjs cunit dxflib mysql-cluster smake
cdrtools dvdrtools ivy shmcat webalizer
==> Deleted Formulae
transcode
unknown7cd1c3e98b07:~ pdenlinger$ rvm install 1.9.3
Ruby (and needed base gems) for your selection will be installed shortly.
Before it happens, please read and execute the instructions below.
Please use a separate terminal to execute any additional commands.
Notes for Mac OS X 10.8.2, Xcode 4.5.2.
For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26"
For IronRuby: Install Mono >= 2.6
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba'
For Opal: Install Nodejs with NPM. See http://nodejs.org/download/
To use an RVM installed Ruby as default, instead of the system ruby:
rvm install 1.8.7 # installs patch 357: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems
rvm alias create default 1.8.7
And reopen your terminal windows.
Xcode and gcc:
:
Added C compiler error:
rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p362.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p362, this may take a while depending on your cpu(s)...
ruby-1.9.3-p362 - #downloading ruby-1.9.3-p362, this may take a while depending on your connection...
ruby-1.9.3-p362 - #extracted to /usr/local/rvm/src/ruby-1.9.3-p362 (already extracted)
ruby-1.9.3-p362 - #configuring
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p362 --with-opt-dir=/usr/local/rvm/usr', please read /usr/local/rvm/log/ruby-1.9.3-p362/configure.log
There has been an error while running configure. Halting the installation.
$ cat /usr/local/rvm/log/ruby-1.9.3-p362/configure.log
[2013-01-01 20:20:35] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p362 --with-opt-dir=/usr/local/rvm/usr
checking build system type... x86_64-apple-darwin12.2.1
checking host system type... x86_64-apple-darwin12.2.1
checking target system type... x86_64-apple-darwin12.2.1
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
Environmental variable flags:
$ brew update
Already up-to-date.
$ brew tap homebrew/dupes
Error: Already tapped!
$ brew install autoconf automake apple-gcc42
Error: autoconf-2.69 already installed
Error: automake-1.12.6 already installed
Error: apple-gcc42-4.2.1-5666.3 already installed
$ rvm pkg install openssl
Fetching openssl-1.0.1c.tar.gz to /usr/local/rvm/archives
Extracting openssl to /usr/local/rvm/src/openssl-1.0.1c
Configuring openssl in /usr/local/rvm/src/openssl-1.0.1c.
Compiling openssl in /usr/local/rvm/src/openssl-1.0.1c.
Installing openssl to /usr/local/rvm/usr
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
Updating openssl certificates
$ rvm reinstall all --force
$ rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p362.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p362, this may take a while depending on your cpu(s)...
ruby-1.9.3-p362 - #downloading ruby-1.9.3-p362, this may take a while depending on your connection...
ruby-1.9.3-p362 - #extracted to /usr/local/rvm/src/ruby-1.9.3-p362 (already extracted)
ruby-1.9.3-p362 - #configuring
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p362 --with-opt-dir=/usr/local/rvm/usr', please read /usr/local/rvm/log/ruby-1.9.3-p362/configure.log
There has been an error while running configure. Halting the installation.
unknown7cd1c3e98b07:~ pdenlinger$ cat /usr/local/rvm/log/ruby-1.9.3-p362/configure.log
[2013-01-02 09:58:08] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p362 --with-opt-dir=/usr/local/rvm/usr
checking build system type... x86_64-apple-darwin12.2.1
checking host system type... x86_64-apple-darwin12.2.1
checking target system type... x86_64-apple-darwin12.2.1
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
$ cat config.log
cat: config.log: No such file or directory
$
What you see is output of rvm requirements it is show using less => use up/down arrows to navigate and q to quit less and continue installation.
The requirements are shown only first time you install ruby.
It was a bug and the broken code is already fixed https://github.com/wayneeseguin/rvm/commit/848ef50f1b32c87e853f21e801f167a39e8c9c66