Surgo / redmine_reposearch

Full-text search of a repository plugin.
15 stars 7 forks source link

install hyperestraier-1.4.13 with rvm #23

Open cforce opened 11 years ago

cforce commented 11 years ago

I use rvm and not a ruby system package installation. I can make install hyperestraier base but can't make rubynative bindings.

user@dev-infomine:~/DevMine_WK/tools/hyperestraier-1.4.13> cd rubynative/ user@dev-infomine:~/DevMine_WK/tools/hyperestraier-1.4.13/rubynative> sudo ./configure checking RUBY... /usr/bin/ruby checking RDOC... /usr/bin/rdoc configure: creating ./config.status config.status: creating Makefile user@dev-infomine:~/DevMine_WK/tools/hyperestraier-1.4.13/rubynative> sudo make ( cd src && if ! [ -f Makefile ] ; then /usr/bin/ruby extconf.rb ; fi ) mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h make: *\ [all] Fehler 1 user@dev-infomine:~/DevMine_WK/tools/hyperestraier-1.4.13/rubynative>

How can i work around the probklem that is use rvm where the ruby.h files are located here

home/user/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/ruby.h /home/user/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby.h /home/user/.rvm/src/ruby-1.9.3-p327/include/ruby/ruby.h /home/user/.rvm/src/ruby-1.9.3-p327/include/ruby.h

seventhsense commented 11 years ago

Because you use sudo. So just chmod src files like this

sudo chmod -R user:user /to/src/files/dir

And you may need this patch.

http://writequit.org/blog/?p=247

cforce commented 11 years ago

I did "chown user:group -R hyperestraierfolder". "ll -a" now shows user and group everyhere I patched , cause i really got this problems. Then i run

user@dev-infomine:~/DevMine_WK/tools/hyperestraier-1.4.13/rubynative> which ruby /home/user/.rvm/rubies/ruby-1.9.3-p327/bin/ruby user@dev-infomine:~/DevMine_WK/tools/hyperestraier-1.4.13/rubynative>

user@dev-infomine:~/DevMine_WK/tools/hyperestraier-1.4.13/rubynative>./configure && make &&sudo make install checking RUBY... /usr/bin/ruby checking RDOC... /usr/bin/rdoc configure: creating ./config.status config.status: creating Makefile ( cd src && if ! [ -f Makefile ] ; then /usr/bin/ruby extconf.rb ; fi ) ( cd src && make ) make[1]: Entering directory /home/user/DevMine_WK/tools/hyperestraier-1.4.13/rubynative/src' make[1]: Für das Ziel »all« ist nichts zu tun. make[1]: Leaving directory/home/user/DevMine_WK/tools/hyperestraier-1.4.13/rubynative/src'

================================================================

Ready to install.

================================================================

mkdir -p /usr/lib/ruby/site_ruby/1.8 ( cd src && cp -Rf estraier.so /usr/lib/ruby/site_ruby/1.8 ) mkdir -p /usr/bin cp -Rf estcmd.rb /usr/bin

================================================================

Thanks for using Hyper Estraier for Ruby.

================================================================

user@dev-infomine:~/DevMine_WK/tools/hyperestraier-1.4.13/rubynative>

I don't understnad how this "RUBY... /usr/bin/ruby" is choosen?

Then i retarted my redmine server and clicked on "repo search" tab and get following error:

Started GET "/projects/s-ibus/reposearch" for 172.11.111.11 at 2013-02-13 14:10:59 +0100 DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in #Module:0xb349634 instead. (called from <top (required)> at /home/user/DevMine_WK/infomine-2.2/plugins/redmine_reposearch/app/controllers/reposearch_controller.rb:21)

LoadError (cannot load such file -- estraier): activesupport (3.2.11) lib/active_support/dependencies.rb:251:in require' activesupport (3.2.11) lib/active_support/dependencies.rb:251:inblock in require' activesupport (3.2.11) lib/active_support/dependencies.rb:236:in load_dependency' activesupport (3.2.11) lib/active_support/dependencies.rb:251:inrequire' plugins/redmine_reposearch/lib/redmine_reposearch.rb:21:in <top (required)>' activesupport (3.2.11) lib/active_support/dependencies.rb:251:inrequire' activesupport (3.2.11) lib/active_support/dependencies.rb:251:in block in require' activesupport (3.2.11) lib/active_support/dependencies.rb:236:inload_dependency' activesupport (3.2.11) lib/active_support/dependencies.rb:251:in require' activesupport (3.2.11) lib/active_support/dependencies.rb:359:inrequire_or_load' activesupport (3.2.11) lib/active_support/dependencies.rb:502:in load_missing_constant' activesupport (3.2.11) lib/active_support/dependencies.rb:192:inblock in const_missing' activesupport (3.2.11) lib/active_support/dependencies.rb:190:in each' activesupport (3.2.11) lib/active_support/dependencies.rb:190:inconst_missing' activesupport (3.2.11) lib/active_support/dependencies.rb:514:in load_missing_constant' activesupport (3.2.11) lib/active_support/dependencies.rb:192:inblock in const_missing' activesupport (3.2.11) lib/active_support/dependencies.rb:190:in each' activesupport (3.2.11) lib/active_support/dependencies.rb:190:inconst_missing' plugins/redmine_reposearch/app/controllers/reposearch_controller.rb:34:in <class:ReposearchController>' plugins/redmine_reposearch/app/controllers/reposearch_controller.rb:21:in<top (required)>' activesupport (3.2.11) lib/active_support/dependencies.rb:251:in require' activesupport (3.2.11) lib/active_support/dependencies.rb:251:inblock in require' activesupport (3.2.11) lib/active_support/dependencies.rb:236:in load_dependency' activesupport (3.2.11) lib/active_support/dependencies.rb:251:inrequire' activesupport (3.2.11) lib/active_support/dependencies.rb:359:in require_or_load' activesupport (3.2.11) lib/active_support/dependencies.rb:502:inload_missing_constant' activesupport (3.2.11) lib/active_support/dependencies.rb:192:in block in const_missing' activesupport (3.2.11) lib/active_support/dependencies.rb:190:ineach' activesupport (3.2.11) lib/active_support/dependencies.rb:190:in const_missing' activesupport (3.2.11) lib/active_support/inflector/methods.rb:230:inblock in constantize' activesupport (3.2.11) lib/active_support/inflector/methods.rb:229:in each' activesupport (3.2.11) lib/active_support/inflector/methods.rb:229:inconstantize' activesupport (3.2.11) lib/active_support/dependencies.rb:554:in get' actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:69:incontroller_reference' actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:54:in controller' actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:32:incall' journey (1.0.4) lib/journey/router.rb:68:in block in call' journey (1.0.4) lib/journey/router.rb:56:ineach' journey (1.0.4) lib/journey/router.rb:56:in call' actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:601:incall' rack-openid (1.3.1) lib/rack/openid.rb:98:in call' actionpack (3.2.11) lib/action_dispatch/middleware/best_standards_support.rb:17:incall' rack (1.4.4) lib/rack/etag.rb:23:in call' rack (1.4.4) lib/rack/conditionalget.rb:25:incall' actionpack (3.2.11) lib/action_dispatch/middleware/head.rb:14:in call' actionpack (3.2.11) lib/action_dispatch/middleware/params_parser.rb:21:incall' plugins/redmine_dmsf/lib/redmine_dmsf/webdav/no_parse.rb:33:in call' actionpack (3.2.11) lib/action_dispatch/middleware/flash.rb:242:incall' rack (1.4.4) lib/rack/session/abstract/id.rb:210:in context' rack (1.4.4) lib/rack/session/abstract/id.rb:205:incall' actionpack (3.2.11) lib/action_dispatch/middleware/cookies.rb:341:in call' activerecord (3.2.11) lib/active_record/query_cache.rb:64:incall' activerecord (3.2.11) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in call' actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:28:inblock in call' activesupport (3.2.11) lib/active_support/callbacks.rb:405:in _run__520739413__call__876486357__callbacks' activesupport (3.2.11) lib/active_support/callbacks.rb:405:in__run_callback' activesupport (3.2.11) lib/active_support/callbacks.rb:385:in _run_call_callbacks' activesupport (3.2.11) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (3.2.11) lib/action_dispatch/middleware/remote_ip.rb:31:incall' actionpack (3.2.11) lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' actionpack (3.2.11) lib/action_dispatch/middleware/show_exceptions.rb:56:incall' railties (3.2.11) lib/rails/rack/logger.rb:32:in call_app' railties (3.2.11) lib/rails/rack/logger.rb:16:inblock in call' activesupport (3.2.11) lib/active_support/tagged_logging.rb:22:in tagged' railties (3.2.11) lib/rails/rack/logger.rb:16:incall' actionpack (3.2.11) lib/action_dispatch/middleware/request_id.rb:22:in call' rack (1.4.4) lib/rack/methodoverride.rb:21:incall' rack (1.4.4) lib/rack/runtime.rb:17:in call' activesupport (3.2.11) lib/active_support/cache/strategy/local_cache.rb:72:incall' rack (1.4.4) lib/rack/lock.rb:15:in call' actionpack (3.2.11) lib/action_dispatch/middleware/static.rb:62:incall' rack-cache (1.2) lib/rack/cache/context.rb:136:in forward' rack-cache (1.2) lib/rack/cache/context.rb:245:infetch' rack-cache (1.2) lib/rack/cache/context.rb:185:in lookup' rack-cache (1.2) lib/rack/cache/context.rb:66:incall!' rack-cache (1.2) lib/rack/cache/context.rb:51:in call' railties (3.2.11) lib/rails/engine.rb:479:incall' railties (3.2.11) lib/rails/application.rb:223:in call' rack (1.4.4) lib/rack/content_length.rb:14:incall' railties (3.2.11) lib/rails/rack/log_tailer.rb:17:in call' rack (1.4.4) lib/rack/handler/webrick.rb:59:inservice' /home/sidfunktion/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:138:in service' /home/sidfunktion/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:94:inrun' /home/sidfunktion/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

seventhsense commented 11 years ago

About RVM. RVM usually install Ruby into each user's directory. So user who use RVM can use ruby, but root who dont use RVM cant use ruby command.

Next problem, it seems difficult to analysis caution.

LoadError (cannot load such file -- estraier):

How about try example rb code to make sure that ruby binding is installed? http://fallabs.com/hyperestraier/rubynativeapi/

cforce commented 11 years ago

So user who use RVM can use ruby, but root who dont use RVM cant use ruby command.

So i need to do a rvm multiuser install ? "If the install script is run prefixed with sudo, RVM will automatically install into /usr/local/rvm Please see the troubleshooting page for an important note regarding Multi-User Installs." (https://rvm.io/rvm/install/#explained) How did you do it (using ruby 1.9 on opensuse 11.4 is not possible from package managment)?

How about try example rb code to make sure that ruby binding is installed?

I did and excueted the Gatherer, see results ;(

/home/sidfunktion/.rvm/rubies/ruby-1.9.3-p327/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/user/DevMine_WK/infomine-2.2/plugins/redmine_reposearch/test/hyperestraier_gatherer.rb /home/sidfunktion/DevMine_WK/infomine-2.2/plugins/redmine_reposearch/test/hyperestraier_gatherer.rb:1:in require': cannot load such file -- estraier (LoadError) from /home/sidfunktion/DevMine_WK/infomine-2.2/plugins/redmine_reposearch/test/hyperestraier_gatherer.rb:1:in<top (required)>' from -e:1:in load' from -e:1:in

'

Process finished with exit code 1

seventhsense commented 11 years ago

I tried again in the same situation. And indeed, it is.

`require': cannot load such file -- estraier (LoadError)

Caution is probably that..

mkdir -p /usr/lib/ruby/site_ruby/1.8 ( cd src && cp -Rf estraier.so /usr/lib/ruby/site_ruby/1.8 ) mkdir -p /usr/bin cp -Rf estcmd.rb /usr/bin

RVM doesnt recognize the path above. and estcmd.rb is using #/usr/bin/ruby.

So I propose that you install ruby natively without rvm. (I usually use rvm but I have installed ruby natively for my redmine server. Ive forgotten that)

If you copy these libraries to your rvm lib directory and fix path, you could do it. But it is not testified fully in this situation. and library is not updated.

seventhsense commented 11 years ago

Additionally

Regarding this , refer http://favstar.fm/users/kushun_/status/60698252936347650

I commented out line 1650 in configure file.

#PATH="..:$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"

and at rubynative path

make clean
./configure
make
sudo make install

In this case, I could install library estraier successfully into my rvm path.

$ sudo make install
[sudo] password for seventh: 
mkdir -p /home/seventh/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1
( cd src && cp -Rf estraier.so /home/seventh/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1 )
mkdir -p /home/seventh/.rvm/rubies/ruby-1.9.3-head/bin
cp -Rf estcmd.rb /home/seventh/.rvm/rubies/ruby-1.9.3-head/bin

#================================================================
# Thanks for using Hyper Estraier for Ruby.
#================================================================
ruby search.rb

At your own risk.

cforce commented 11 years ago

"There's a land that I heard of once in a lullaby." OH YEAAAAH!!! hyperstraier does now work with my rvm ruby 1.93

But i does not work on redmine! ..umfg! When i click on repo search tab i get this:

Started GET "/projects/bus/reposearch" for 172.25.252.98 at 2013-02-15 14:16:58 +0100

SystemStackError (stack level too deep): activesupport (3.2.11) lib/active_support/callbacks.rb:409

[2013-02-15 14:16:59] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true

Using redmine 2.2.2 stable. Any ideas?