cannot build apache thrift due to ruby rake errors - rake

I am trying to build thrift from source tarball (https://dist.apache.org/repos/dist/release/thrift/0.9.0/thrift-0.9.0.tar.gz), but it fails with this error:
Making all in rb
make[3]: Entering directory `/home/akonsu/a/thrift-0.9.0/lib/rb'
/usr/local/bin/rake
rake aborted!
cannot load such file -- rspec/core/rake_task
I would appreciate any help.

this helped:
gem install rspec

What also helps, if you are not interested in Ruby in the first place, is configure Thrift to do without.
$ ./configure --without-ruby
So that is --without-ruby, and NOT --without-rb as some other sources suggest.
and then run make and sudo make install.
It is a known bug apparently.
I found this here: https://issues.apache.org/jira/browse/THRIFT-1367
(I am on on Mac OS X 10.7.5, BTW. I don't know about any other versions/platforms...)

Related

How can I solve this error and install cocoapods?

In my terminal I use:
sudo gem install cocoapods
My terminal gives the error shown below. How can I solve this? I have tried a few variations and I cannot get it to work.
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200518-1427-ajbhbt.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h
You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.12.2/gem_make.out
Agree with Vinayaka and Bryan you're missing some ruby header files and it looks like they're required. Not sure about your environment setup but it may help to just reinstall the latest Xcode from scratch.
Also, I've had some recent problems with Cocoapods installed via terminal. The terminal installs the latest build of Cocoapods. If you're looking for something stable then maybe try the Cocoapods app. It's clunky and it can't read pod files from the latest version of Cocoapods (so you'll have to regenerate any existing podfiles) but its easier to work with especially for those who prefer a graphical environment.
We need to install Xcode's developer tools. The easiest way to do this is through terminal .
xcode-select --install
Later, if there are any write permission issues, use the below code.
sudo gem install cocoapods -n /usr/local/bin/..
P.S: -n specifies the directory where binaries are located.
Please try with
brew install cocoapods

Why can't TeamCity run this Rake build using Albacore?

I created a build script using Rake & Albacore which builds a solution and executes unit tests. I am trying to set it up in TeamCity. I am getting this error.
Cannot start build runner: If you wan't to use bundler please install
it at first. The gem wasn't found in Gem paths of Ruby SDK with
interpreter: 'C:\Ruby187\bin/ruby.exe'.
Hide stacktrace
jetbrains.buildServer.agent.rakerunner.RakeTasksBuildService$MyBuildFailureException:
If you wan't to use bundler please install it at first. The gem wasn't
found in Gem paths of Ruby SDK with interpreter:
'C:\Ruby187\bin/ruby.exe'. Gem paths: C:/Ruby187/lib/ruby/gems/1.8
C:/Users/af/.gem/ruby/1.8
I added one parameter, where Albacore is installed. But, I am still getting the error.
GEM_PATH=C:\Ruby187\lib\ruby\gems\1.8\gems\albacore-0.3.4\albacore.gemspec
Ok finally was able to resolve the problem. I simply created a batch file that executes the rake task and instead of using "Rake Build Step" in Team city; used the command line build step and executed the batch file. It also gives me complete log of all the build steps, tests run etc.
Hopefully this will help someone else too. You don't need to setup a Rake Build Step as it turns out.
It's not clear that Albacore was missing. The error message indicates that TeamCity cannot find Rake itself!
Cannot start build runner
What was the exact Rake task configuration? Specifically the Ruby Interpreter configuration section? You can tell TeamCity exactly which Ruby to run, which will affect which gems are available (and Rake is just a gem).
It looks like you have a Ruby 1.8.7 installed and that you must have installed Albacore
cmd> gem install albacore
Do you also have Rake installed? In Ruby 1.8.7, the Rake gem was not included by default. You can list the machine's installed gems by
cmd> gem list --local
You'll should install Rake.
cmd> gem install rake
I'm not actually sure how you ended up getting this to work. What's the contents of the batch file? Do you have any other Ruby/Rake installed?

Installing mod_perl-2.0.7 on Apache httpd-2.4.2

I am having an infuriating time trying to get an install of apache with perl. I am following the instructions on the mod_perl site located here: http://perl.apache.org/docs/2.0/user/install/install.html
I get as far as the part where it asks me to run this command, but I get an error:
$ perl Makefile.PL MP_APXS=/usr/local/httpd/prefork/bin/apxs
Reading Makefile.PL args from #ARGV
MP_APXS = /usr/local/httpd/prefork/bin/apxs
no conflicting prior mod_perl version found - good.
Configuring Apache/2.4.2 mod_perl/2.0.7 Perl/v5.12.3
[ error] Can't find apr include/ directory,
[ error] use MP_APR_CONFIG=/path/to/apr-config
I ran the commands they suggested for installing apache to install my apache:
$ ./configure --prefix=$HOME/httpd/prefork --with-mpm=prefork
$ make && make install
But I am not sure where this apr-config thing is supposed to be as it doesn't appear to be anywhere in my apache2 folder.
If it might be an issue, I am using Mac OS X 10.7.3. I know an apache server comes with Mac OS X, but I need to do this install on a different computer from the ground up, so I have to start this whole install from the ground up on my computer.
Thanks ahead of time for any help you can provide.
When mod_perl 2.0.8 comes out, I hope that it gets finally httpd 2.4 support, because the current versions surely don't have.
When you fix your initial problems, you will eventually get stuck at ‘conn_rec’ has no member named ‘remote_ip’. Delete httpd 2.4 and use 2.2 meanwhile.
You need to include the path to binary executable file apr-1-config. Run the below command
perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs MP_APR_CONFIG=/usr/local/apr/bin/apr-1-config
It worked for me..Hope the same for you too.
On Lion here, my APR include directory seems to be /usr/include/apr-1, but it already came with mod_perl.
$ find / -name apr*
/usr/include/apr-1
...
$ find / -name mod_perl.so
/usr/libexec/apache2/mod_perl.so
If you have the .so already you should be able to just add in your config file:
LoadModule perl_module libexec/apache2/mod_perl.so

Can Sinatra be used with IronRuby?

I'm trying to install the following ruby gem on my mac:
http://www.sinatrarb.com/intro.html
I get the following message:
michael-rosarios-macbook:bin michaelrosario1$ mono ir.exe igem sinatra
ERROR: While executing gem ... (RuntimeError)
Unknown command sinatra
michael-rosarios-macbook:bin michaelrosario1$
Can someone more familiar with Ruby/IronRuby help me out?
It appears that I had missed an argument installing sinatra:
michael-rosarios-macbook:bin michaelrosario1$ mono ir.exe igem install sinatra
Successfully installed rack-1.0.0
Successfully installed sinatra-0.9.4
2 gems installed
Installing ri documentation for rack-1.0.0...
Installing ri documentation for sinatra-0.9.4...
Installing RDoc documentation for rack-1.0.0...
Installing RDoc documentation for sinatra-0.9.4...
I'm now experiencing issues with writing a "hello world" example using Sinatra. This is probably related to Shay's comment. Any other thoughts!?
First thing - I'm not familiar with mono, but on Windows I would execute "igem sinatra" without ir before that. Maybe that's the problem?
Anyways, if you're having troubles installing the gem using igem, try MRI gem installer instead.
After that you'll be able to use it via IronRuby with a tiny tweak.
On your ruby file add the next line:
$LOAD_PATH << path_to_mri_gems_folder
where path_to_mri_gems_folder would be the full path to the MRI gems folder.
After this line require sinatra.
There is also a patch of the IronRuby team for Sinatra, I'm not sure if it's still needed:
http://www.ironruby.net/Documentation/Real_Ruby_Applications/Sinatra
Shay.

libxml-ruby on windows xp problem

About a month ago I installed libxml-ruby using
gem install libxml-ruby
and it worked fine.
Then i went to install it on another machine today and it failed with this error:
C:\Windows\system32>gem install -r libxml-ruby
Building native extensions. This could take a while...
ERROR: Error installing libxml-ruby:
ERROR: Failed to build gem native extension.
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake RUBYARCHDIR=c:/ruby/lib/ruby/
gems/1.8/gems/libxml-ruby-1.1.3-x86-mswin32-60/lib RUBYLIBDIR=c:/ruby/lib/ruby/g
ems/1.8/gems/libxml-ruby-1.1.3-x86-mswin32-60/lib
'c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake' is not recognized as an int
ernal or external command,
operable program or batch file.
Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/libxml-ruby-1.
1.3-x86-mswin32-60 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.3-x86-mswin32-6
0/ext/mingw/gem_make.out
I have rake installed and win32-api
I then got confused if I had really installed libxml-ruby on my machine previously and tried uninstalling and reinstalling it. It now fails with the same error message on my machine and some scripts i've written to parse xml, which used to work, no longer work. Has anyone else tried installing libxml-ruby lately on windows xp? It appears to be completely broken.
I got the same problem, and ended up figuring out a decent work-around.
It seems the error is correct
'c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake'
isn't a valid executable. It needs to run rake from the root ruby/bin folder, where the wrapping batch file can be found.
Rummaging through the rubygems code, I found that Gem::Ext::RakeBuilder tries to build extensions using
cmd = ENV['rake'] || Gem.bin_path('rake') rescue Gem.default_exec_format % 'rake'
So, simply setting the rake environment variable to something valid before running the gem install should help:
C:\>set rake=c:\ruby-1.8.6-26\bin\rake.bat
C:\>gem install libxml-ruby --no-rdoc --no-ri
Building native extensions. This could take a while...
Successfully installed libxml-ruby-1.1.3-x86-mswin32-60
1 gem installed
(I skipped installing rdoc and ri because it prints out a bunch of formatting warnings, making it more difficult to paste the results in here.)