Unable to execute 'thrift' command after 'gem install thrift' - ruby

I'm trying to try some thrift development on the Mac but after 'gem install thrift' is successfully run and thrift is listed in 'gem list', executing 'thrift' gives me a command not found error. I'm running rvm and have tried several versions of ruby from ruby-1.8.7-p358 to ruby-2.0.0-p195. I'm looking for troubleshooting tips or any other suggestions. Thanks.

The documentation at http://rubydoc.info/gems/thrift/0.9.0/frames includes the caveat
This library provides the client and server implementations of thrift. It does not provide the compiler for the .thrift files. To compile .thrift files into language-specific implementations, please download the full thrift software package.
This would indicate to me that there might not be any command line feature installed as part of this gem. Have you tried to invoke the library from Ruby?

Related

'fop is missing' while installing Erlang using asdf in Mac

I'm getting the below error while trying to install Erlang using ASDF.
fop is missing
using fakefop to generate placeholder pdf file.
What can I do to fix it?
fop is used to generate documentation in PDF format. You probably won't need it, as most of the time it's easier to look up things in the documentation online, either on the official site, http://erlang.org/doc/, or using the alternative interface at https://erldocs.com/.
So you can safely ignore this error message.
Install fop:
https://xmlgraphics.apache.org/fop/
I've never bothered, though.
I have this error when trying to install Erlang 24.0.5. So, I installed the fop dependency:
brew install libxslt fop
But as mentioned this was not the root cause of my installation issue.
So, I run:
export KERL_CONFIGURE_OPTIONS="--without-wx --without-javac"
asdf install erlang <version>
and I was able to finish the erlang install.
References:
https://github.com/asdf-vm/asdf-erlang#osx
https://erlangforums.com/t/erlang-installation-using-kerl-on-mac-m1-openssl-dependency/1306/5

Installation of asciidoctor on osx 10.11.5 for newbie?

I tried to follow the installation process defined at: http://asciidoctor.org/docs/install-asciidoctor-macosx/#rvm-procedure-recommended but it failed with the error message
Error running 'requirements_osx_brew_update_system ruby-2.3.0',
showing last 15 lines of
/Users/richardcoffre/.rvm/log/1466510618_ruby-2.3.0/update_system.log
Because I am a newbie, but want to use asciidoc format, I need an updated and detailed installation process to install asciidoctor.
Best regards
Richard
Install Homebrew
brew install ruby
Open new terminal tab/window
which gem, it should print /usr/local/bin/gem
gem install asciidoctor
We should probably create a Homebrew package for Asciidoctor, it's unnecessary complicated now.
I am aware this does not exactly answer your question...
An alternative to this installation approach is to use an Application like AsciidoctorFX:
Or even simpler the preview extension for chrome:
If you are a developer, there is a good integration with several build system (maven, gradle, rake, gulp, grunt...). In that case the package manager will download Asciidoctor and the dependencies for you.

Building CompassApp (jruby app) executable from source on Windows

I would like to build the executable of CompassApp, a GUI application that lets webdesigners compile stylesheets by using SASS and Compass without using the command line.
The source can be found on GitHub here: https://github.com/handlino/CompassApp.
CompassApp is a an application developed in Jruby.
From the GitHub webpage of the project:
If you want to build your own copy, you will need JRuby and rawr
I am using Windows 7 as operating system for my webdesign projects. I never built a jruby app from source. It seems on linux it's easier to install the required things, anyway i'm using Windows now.
First i cloned the GitHub repository.
Then i installed jruby.
Now i should install rawr (https://github.com/rawr/rawr)
It seems that rawr also requires javac and rake
I saw that rawr and rake are 2 ruby gems.
So how do i install those 2 ruby gems for jruby on Windows?
And how do i build CompassApp from source after i have everything i need?
I would need a step by step guide from the install of the requirements
to the build of the application.
(i never used jruby in the past).
If someone of you develops apps in jruby i think that can help me easily.
I thank you in advance.
#Fabio Hi, we made Compass.app and Fire.app :-)
It is easy to build Compass.app on OS X or Linux. We have a (almost) step by step guide about building Fire.app on the GitHub wiki and it can be applied to Compass.app too: https://github.com/handlino/FireApp/wiki
We have never tried to build it on Windows, and do not think it can be done easily.
I'm trying to do a similar thing, but in my case only package the gems in a self-contained executable jar. the docs are not very descriptive and some are outdated.
I tried rawr but managed to get further with warbler
here's what I did: I created a folder named jrcompass and installed compass into it:
c:\test\jrcompass>%JRUBY%\jruby -S gem install compass -i .
I installed warbler and then ran the warble command in that folder:
C:\test\jrcompass>c:\apps\jruby\bin\jruby -S warble
that created a ~20MB jar file named jrcompass.jar which is farther than I got with rawr.
now I'm trying to execute the jar with:
C:\test\jrcompass>java -jar jrcompass.jar
and I get the following error below. I hope that this will help you make progress. please let me know if you figure it out.
Gem::LoadError: Could not find compass (>= 0) amongst [rake-0.9.2.2]
to_specs at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby1564362137331239458extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb:247
to_spec at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby1564362137331239458extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb:256
gem at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby1564362137331239458extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems.rb:1231
(root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/jrcompass/bin/compass:22
load at org/jruby/RubyKernel.java:1046
(root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/META-INF/main.rb:1
require at org/jruby/RubyKernel.java:1027
(root) at file:/C:/Apps/test/jrcompass/jrcompass.jar!/META-INF/main.rb:1
(root) at jar:file:/C:/Users/Admin/AppData/Local/Temp/jruby1564362137331239458extract/jruby-stdlib-1.7.1.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:1

How do I build a gem that allows for linking against different native libraries at install time?

Nokogiri allows for this by specifying the libraries in the install command:
gem install nokogiri -- --with-xml2-lib=/home/joe/builds/lib
--with-xml2-include=/home/joe/builds/include/libxml2
--with-xslt-lib=/home/joe/builds/lib
--with-xslt-include=/home/joe/builds/include
I did a little digging through Nokogiri's source to try to find out how they allow for those options to get passed down from the command to the actual build/installation.
I noticed the use of Rake::ExtensionTask as well as mini_portile, however their use seems to be limited to cross compiling on Windows systems in their code.
Is there some bit of code I can throw in my gem to allow users to specify the library they want to link against at install time? How did nokogiri allow for this?
This is using the dir_config method of the mkmf library.
The gem install command uses any arguments after -- as arguments to the build command, so they get passes to your extconf.rb.
Note you still need to use have_library or find_library in order to actually link to the library.

Rubygems auto install from source code

I was wondering if there was a solution to automatically - from my ruby source code - ask Gem to install various librairies my code my require to work?
From what i read on the internet, it seems we are obliged to either use an install script that directly runs "gem install ..." commands or do it manually or some people have posted a ruby script that simply iterate over a list of dependencies and use the system command to install them.
Any other better options?
Thanks for your time.
You could use internal RubyGems commands, but that's a pain and error-prone process, especially for dependencies.
I would setup a Gemfile and use Bundler instead. http://github.com/carlhuda/bundler

Resources