Installing Ruby using rbenv on Deepin 15.10 - ruby

Trying to install Ruby using rbenv (or any other installer I tried RVM and ruby-install) fails and gives this error
$ rbenv install 2.6.3
> Downloading ruby-2.6.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.bz2
Installing ruby-2.6.3...
ruby-build: use readline from homebrew
BUILD FAILED (Deepin 15.10 using ruby-build 20190423)
Inspect or clean up the working tree at /tmp/ruby-build.20190507002901.29361
Results logged to /tmp/ruby-build.20190507002901.29361.log
Last 10 log lines:
from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/package.rb:44:in `<top (required)>'
from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/installer.rb:11:in `<top (required)>'
from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from ./tool/rbinstall.rb:703:in `<module:RbInstall>'
from ./tool/rbinstall.rb:639:in `<main>'
uncommon.mk:364: recipe for target 'do-install-all' failed
make: *** [do-install-all] Error 1

FINALLY FIXED IT !!
I had to use brew unlink openssl
then sudo apt-get install -y libssl-dev zlib1g-dev
then i tried rbenv install 2.6.3 and IT WORKED !

Try this:
$ TMPDIR=~/tmp/ rbenv install 2.6.3

Related

ta-lib gem not installing dependencies?

I am trying to run a simple example script from here, but even after installing requisite gems with no errors I get an error when running the script. It looks like libta_lib.so cant be found, but nothing in the install commands below had an error. Any idea what I am missing? Im happy to provide more data if needed, I just dont know what would be useful.
I ran:
#compiling ta-lib from source
gem uninstall talib_ruby
gem uninstall ta-indicator
make clean
sudo ./configure LDFLAGS="-lm"
sudo make
sudo make install
gem install talib_ruby
gem install ta-indicator
king#death-star ~/Desktop/_REPOS/misc/stock_analysis/forex/oanda/ruby $ ruby -e "require 'talib_ruby'; l = TaLib::Function.new('MA') "
/home/king/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': libta_lib.so.0: cannot open shared object file: No such file or directory - /home/king/.rvm/gems/ruby-2.3.0/gems/talib_ruby-1.0.6/lib/talib.so (LoadError)
from /home/king/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/king/.rvm/gems/ruby-2.3.0/gems/talib_ruby-1.0.6/lib/talib_ruby.rb:5:in `<top (required)>'
from /home/king/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /home/king/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /home/king/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from -e:1:in `<main>'
As per this follow these steps
sudo gedit /etc/ld.so.conf
Append below line and save:
include /usr/local/lib
run sudo /sbin/ldconfig

Can't get to work CocoaPods and Yosemite

I already tried this steps:
Open Xcode 6 Open Preferences
Click the Locations tab
Change the Command Line Tools version to Xcode 6.0
Uninstall cocoapods
a. $sudo gem uninstall cocoapods Install xcodeproj
a. $ sudo gem install
xcodeproj Install cocoapods
a. $ sudo gem install cocoapods
Run pod --version to verify that it worked
But I'm still gettings this when I do pod install or pod --version:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- xcodeproj/prebuilt/universal.x86_64-darwin14-2.0.0/xcodeproj_ext (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:6:in `rescue in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:3:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj.rb:30:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods.rb:2:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:32:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'
In case someone else got the same issue, I did this to fix my issue:
Update Gems
sudo gem update --system
Uninstalled xcodeproj
sudo gem uninstall xcodeproj
Make sure to select All versions
Uninstalled Cocoapods
sudo gem uninstall cocoapods
Install xcodeproj
sudo gem install xcodeproj
Install cocoapods
sudo gem install cocoapods
Run
pod --version to test.
Running these 2 lines will resolve your problem
sudo gem update --system
sudo gem install cocoapods
I had to uninstall the entire dependency chain for cocoapods to get it to work.
for i in `gem list --no-versions`; do gem uninstall -aIx $i; done
see Uninstall all installed gems, in OSX?
Many of this issues are because of system-wide ruby installation and it forces developers to use "sudo" all the time (well, how many times we did "sudo gem install cocoapods --pre"). I recently had the same issue trying to install a pre-released version of cocoapods (permissions were messed up). So here is a approached that worked for me.
$ sudo gem uninstall xcodeproj
$ sudo gem uninstall cocoapods
# Let's restore Apple's ruby installation, the following is for Yosemite that has 2.0 ruby by default
$ cd /System/Library/Frameworks/Ruby.framework/Versions
$ sudo rm Current
$ sudo ln -s 2.0 Current
$ brew install ruby
(closing and opening terminal window sometimes help)
$ which ruby
should display /usr/local/bin/ruby
(should point to "local" directory now, not to "/usr/bin", if this is not the case for you, make sure to modify path order)
Now you should be able to install xcodeproj and cocoapods without using "sudo":
$ gem install xcodeproj --pre
$ gem install cocoapods --pre
(I'm using pre-released version, just remove --pre if you want to use releases instead).
Enjoy :)
The error 'require': cannot load such file indicates that you some missing or broken gem package. You can probably fix it by re-installing cocoapods:
gem uninstall cocoapods # Follow by sudo if necessary
gem install cocoapods --verbose # Follow by sudo if necessary
And make sure that your xcodeproj is present:
gem install xcodeproj --verbose # Follow by sudo if necessary
If won't help, try to install it by using older Ruby:
sudo ln -s /Library/Ruby/Gems/1.8/gems/rubygems-update-1.8.12/bin/gem /usr/bin/gem18
sudo gem18 install cocoapods
See:
Managing Rails Versions and Gems
You just have to execute this commande before :
sudo gem install cocoapods
This will update all outdated gems

very stuck with cocoapods / ruby setup

This was working fine and then suddenly it wasn't. I wish i knew why. Really stuck and cannot find anything online. I'm working on an ObjectiveC project. I've tried reseting everything with:
$ sudo gem uninstall ruby
$ sudo gem uninstall cocoapods
then
$ sudo gem install ruby
$ sudo gem install cocoapods
$ sudo gem update ruby
$ sudo gem update cocoapods
then i when in my projects directory i run
$pod install
and get the following error. I get this on all projects.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require': cannot load such file -- cocoapods-core (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb:8:in `<module:Pod>'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb:4:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/bin/pod:23:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'
Any ideas/clues/answers would be very appreciated.
I reinstalled cocoa pods by running
$ sudo gem uninstall cocoapods-core cocoapods-downloader cocoapods
$ sudo gem install cocoapods
That resolved the issue for me
Looks like you're missing one of CocoaPod's dependencies. You should be able to install it with:
[sudo] gem install cocoapods-core
You should stop using "sudo" for tasks such as "gem install" etc. Here is a little tutorial on how to fix your ruby to ensure that you are not going to see issues with permissions for cocoapods (and other gems):
Can't get to work CocoaPods and Yosemite

error Installing linecache19 gem bundler rvm

I'm failing to install linecache19 gem via bundler with an rvm installation of ruby 1.9.2 on aptosid (ie debian sid).
I am new to ruby but my ruby installation is clearly not completely mis-configured as I have been able to install rails and a bunch of gems.
The output I get is the following:
Installing linecache19 (0.5.12) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/caz/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
/home/caz/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- openssl (LoadError)
ms/custom_require.rb:36:in `require'
in `<top (required)>'
ms/custom_require.rb:36:in `require'
from /home/caz/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/caz/.rvm/gems/ruby-1.9.2-p320/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:11:in `<top (required)>'
from /home/caz/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/caz/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/caz/.rvm/gems/ruby-1.9.2-p320/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:6:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:33:in `require'
from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from extconf.rb:2:in `<main>'
Gem files will remain installed in /home/caz/.rvm/gems/ruby-1.9.2-p320/gems/linecache19-0.5.12 for inspection.
Results logged to /home/caz/.rvm/gems/ruby-1.9.2-p320/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
An error occured while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
I have tried the solution which is usually suggested:
gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-p320
I have also tried using the --force option without success as per the following:
Installing Gems without rvm, as root, with explicit version of ruby
I'm confused by the presence of "1.9.1" in the path reported in the output- I wonder whether this is a hangover of the debian ruby package and the source of my problems.
ps this is all in aid of installing the Smallest Federated Wiki. I encourage readers to take a look at this project.
in your terminal enter rvm requirements
It will provide you with something like
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
go ahead and copy the command and run it. It will install all dependencies required for running ruby.

Heroku gem not working with RVM

I'm following the Ruby on Rails tutorial at http://railstutorial.org/chapters/beginning#sec:1.4.1, and all is going well until I tried to get my app going on Heroku.
I installed heroku, that worked fine, but now when I run heroku keys:add or any other heroku command, I get the following error:
/home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rest-client-1.4.2/lib/restclient.rb:9:in `rescue in <top (required)>':
no such file to load -- net/https. Try running apt-get install libopenssl-ruby (LoadError)
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rest-client-1.4.2/lib/restclient.rb:5:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rest-client-1.4.2/lib/rest_client.rb:2:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/heroku-1.9.14/lib/heroku/client.rb:2:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/heroku-1.9.14/lib/heroku.rb:3:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/heroku-1.9.14/bin/heroku:6:in `<top (required)>'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/bin/heroku:19:in `load'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/bin/heroku:19:in `<main>'
I did what the error message said, and installed libopenssl-ruby, but heroku still didn't work.
I've done a search and found the following two pages which try to combat the heroku errors:
http://www.mail-archive.com/heroku#googlegroups.com/msg05001.html
http://blog.project-sierra.de/archives/1534
I followed the instructions on these pages (which are the same), but heroku still doesn't work.
I usually do my work on windows, so everything is a bit new to me on ubuntu. Here's my ruby environment:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i686-linux]
- INSTALLATION DIRECTORY: /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial
- RUBY EXECUTABLE: /home/sirswap/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
- EXECUTABLE DIRECTORY: /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial
- /home/sirswap/.rvm/gems/ruby-1.9.2-p0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I'm running ubuntu 10.04.
Any help or advice for next steps would be much appreciated :)
I experienced the same problem, and I think it was caused by not installing all the ruby dependencies listed when you run:
$rvm requirements # it was earlier: rvm notes
Specifically, I executed [be sure to install aptitude first]:
$sudo aptitude install build-essential bison openssl libreadline5 libreadline5-dev curl git zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev
and after all that, I recompiled my ruby install (using $rvm reinstall 1.9.2) and heroku worked like a charm.
Hey :)
Don't know if it's still relevant or whether this will work for you as well.. it did for me.
Had the exact same problem..
I also noticed when doing
$ rails console
I was getting errors which indicated I had problems with Readline.
Following http://rvm.beginrescueend.com/packages/readline/ helped me fix all issues I was experiencing.
I blew many hours on this yesterday. Eventually, somewhat by chance (actually more like sheer desperation), I looked in the file /usr/bin/heroku
I noticed the first line of the script said
#!/usr/bin/env ruby1.9.1
I changed this to
#!/usr/bin/env ruby
and it started working. After re-installing ruby about 10 times and all that mucking around with openssl. rolleyes
I'm also doing the Railstutorial on Ubuntu 10.10 and got the exact same error while trying to add Heroku keys. This solves it:
$ rvm remove 1.9.2
$ rvm pkg install openssl
$ rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr
Read my directions on how to install RVM on Linux. You need to install libssl-dev or things like net/https won't work. It's OK though, just install that and recompile your rubies.
In your case "recompiling your rubies" can probably be done by issuing:
rvm install
Or alternatively you might make some progress by manually recompiling the openssl extension:
cd /home/sirswap/.rvm/src/ruby-1.9.2-p0/ext/openssl
ruby extconf.rb
make
make install
Please reinstall ruby. I was same problem and fixed by reinstalling ruby.
rvm reinstall ruby 1.9.2

Resources