Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

how to compile #7

Closed
jluis859 opened this issue Nov 23, 2011 · 27 comments
Closed

how to compile #7

jluis859 opened this issue Nov 23, 2011 · 27 comments

Comments

@jluis859
Copy link

Hi, Do you use netbeans or eclipse for this?

I'm only a starter and I'm trying to compile this in netbeans, with rails.

Is there a tutorial in some part?

Greetings.

@issa-tseng
Copy link
Member

I'm not sure I follow. There is no compilation process, since Ruby is an interpreted language. The directions in the Readme are going to be what you need to run in order to get off the ground. I could summarize here, but it would just end up reading like the Readme does.

If you're having trouble with some specific step of the readme, I'd be glad to help.

Also remember that if you only have interest in using ODK Build, not in developing on it, you can do so simply by visiting http://build.opendatakit.org . No compilation necessary.

@jluis859
Copy link
Author

thanks, I'm interested also in developing, I will try with the readme.
PS: I have windows for now.

@jluis859
Copy link
Author

I have been fighting with the eventmachine and I have this error, I have also the devkit, maybe my problem is that I have windows.
Here the error when I use -> bundle install
http://pastebin.com/AzTDaUUT
And when I use -> gem install eventmachine -v '0.12.10'
http://pastebin.com/yufDEDtj

Greetings.

@jluis859
Copy link
Author

when I do bundle install I have problems with the tokyo tyrant lib and also with json

Here the error with json when I try with exec:
Invalid gemspec in [C:/Ruby187/lib/ruby/gems/1.8/specifications/json-1.6.1.gemspec]: invalid date format in specification: "2011-09-18 00:00:00.000000000Z"
Invalid gemspec in [C:/Ruby187/lib/ruby/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [C:/Ruby187/lib/ruby/gems/1.8/specifications/json-1.6.1.gemspec]: invalid date format in specification: "2011-09-18 00:00:00.000000000Z"
Invalid gemspec in [C:/Ruby187/lib/ruby/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Could not find json-1.6.1 in any of the sources

@issa-tseng
Copy link
Member

I'm not sure exactly what's wrong here, since I am on *nix machines only, but if you're stil having problems building the eventmachine native extensions my suggestion for Windows would be to install cygwin, put gcc in it, and use that instead. Ruby is somewhat notoriously incompatible with Windows, despite their recent efforts.

If the issue at this point is only the last one you point out, try updating rubygems: gem update --system

@jluis859
Copy link
Author

thanks for answer, I think I will try with ubuntu, I'm installing it at this moment, because windows is a headache for this.

@jluis859
Copy link
Author

same error in ubuntu: Could not find json-1.6.1 in any of the sources

@issa-tseng
Copy link
Member

With the same date format error before it? Did you try updating rubygems?

@jluis859
Copy link
Author

yes, with the same date format error, I tried to update but it said "ERROR: gem update --system is disabled on Debian, because it will overwrite the content of the rubygems Debian package"

@jluis859
Copy link
Author

the message of json fixed with: sudo sed -i 's/ 00:00:00.000000000Z//' /var/lib/gems/1.8/specifications/*

Now I have this error:
jluis859@ubuntu:~/www/odk$ bundle exec rackup config.ru
./model/connection_manager.rb:3:in require': no such file to load -- tokyo_tyrant (LoadError) from ./model/connection_manager.rb:3 from ./model/user.rb:5:inrequire'
from ./model/user.rb:5
from ./warden_odkbuild.rb:3:in require' from ./warden_odkbuild.rb:3 from /home/jluis859/www/odk/config.ru:7:inrequire'
from /home/jluis859/www/odk/config.ru:7
from /var/lib/gems/1.8/gems/rack-1.3.4/lib/rack/builder.rb:51:in instance_eval' from /var/lib/gems/1.8/gems/rack-1.3.4/lib/rack/builder.rb:51:ininitialize'
from /home/jluis859/www/odk/config.ru:1:in `new'
from /home/jluis859/www/odk/config.ru:1

How can I install the tokyo lib? I did with the install.rb, but it didnt work.

jluis859@ubuntu:~/www/tokyotyrant-ruby-1.13$ sudo ruby install.rb
installing the library into /usr/local/lib/site_ruby/1.8 ... "/usr/local/lib/site_ruby/1.8/tokyotyrant.rb"
ok
installing the test command into /usr/bin ... "/usr/bin/tcrtest.rb"
ok
done

@jluis859
Copy link
Author

I used this to update in ubuntu: $ REALLY_GEM_UPDATE_SYSTEM=1 gem update --system

And now I have this message when I use bundle exec rackup config.ru:
Could not find ruby-tokyotyrant-0.5.1 in any of the sources

@jluis859
Copy link
Author

https://launchpad.net/ubuntu/maverick/+package/libtokyotyrant-dev
I installed from here the lib of tokyo and now it works with the sudo bundle install :)
Now Setup and Execution =/

@issa-tseng
Copy link
Member

Glad to see you got this far. Please do let me know if you run into any further issues.

@jluis859
Copy link
Author

I did this in a diferent way, I start the service with ttserver -port 45001 data.tch and after that bundle exec shotgun config.ru.
It works after that, now I have the ODK Build in the http://0.0.0.0:9292/
Now I think I have to change the aggregate part for localhost.
Thanks for supporting me :)

@issa-tseng
Copy link
Member

I'm... not convinced that will work. You will at minimum have to configure 3 tyrant instances: one for users, one for forms, and one for formdata. I strongly suspect that if you actually try to save a form with that setup it'll fail.

@jluis859
Copy link
Author

thanks I will review it, now how can I connect my ODK Build with a local Aggregate, I have the aggregate working also.
In resume I mean, How can I publish aggregate in build ODK with a Local aggregate ODK?

@issa-tseng
Copy link
Member

If you give it the URL of the local aggregate (probably localhost:port) it might work. To test this simply modify https://github.com/clint-tseng/odkbuild/blob/master/odkbuild_server.rb#L217 to point at your local machine instead of taking the input param. I say might because possibly Google auth will complain when you try to do this.

@jluis859
Copy link
Author

thanks clint-tseng, now I use the rake db:dev start and it is better, here the log: http://pastebin.com/9GzxSESX
Now I'm trying to compile it in centos because it is more "secure", but with the build it is giving me an error(more troubles :S):

NameError at /
uninitialized constant TokyoTyrant::DB
Ruby /root/Desktop/odk/model/connection_manager.rb: in const_get, line 37
Here an image:
http://imageshack.us/photo/my-images/851/screenshotexa.png/

I commented this lines in connection_manager.rb and it works without tokyo tyrant, but I need the DB and I don know why this error happen

I have tokyotyrant 1.1.41 and I had to change in the require Tokyo_Tyrant for TokyoTyrant in 2 parts of code.

@jluis859
Copy link
Author

Maybe I have a Ruby tokyo tyrant too high version, but I cant find the 0.5.1, in centos I have a problem with the libtokyotyrant and bundle install that is why I am using 1.x

@jluis859
Copy link
Author

fixed with a miracle of bundle install --path .rubygems I dont know how it works =)

@issa-tseng
Copy link
Member

That's a curious one. Try doing a bundle install --deployment and see if it still works. For what it's worth, as long as you pay attention to the default settings, I've never bought the argument that centos is inherently more secure than, say, debian or even ubuntu.

@jluis859
Copy link
Author

jluis859 commented Dec 1, 2011

another trouble to add:
When I used webrick(the default server that comes with ruby on rails) it didnt bind to external calls, it only worked for me only in 127.0.0.1:port, when I tried with myip:port it didnt work.
I solved it with thin server.
gem install thin, then in odk folder, thin -p myport start
And now it works.

@jluis859
Copy link
Author

jluis859 commented Dec 1, 2011

I have my build in: http://127.0.0.1:8084/
And I have my aggregate in: http://127.0.0.1:8080/ODKAggregate/

I tried what you said, but it didnt work.

Firefox can't find the file at http://127.0.0.1:8084/aggregate/post in my linux
In another pc with windows I had this message: NameError at /aggregate/post uninitialized constant Odkbuild::OAuth line 276 location: get_oauth_consumer file: odkbuild_server.rb

I put the http://127.0.0.1:8080/ODKAggregate/ in aggregate_instance_name, in data-ui.js I did this:
http://pastebin.com/JtxzVip5
I put in a var my instance and it should work with this, but it is not working.

And I put also in odkbuild_server.rb
instance_uri = "https://#{params[:aggregate_instance_name]}"
without appspot.com.

Any advice?

@issa-tseng
Copy link
Member

Yeah, I've had various software stacks over the years that work better with thin. I'll add that to the README as a suggestion.

I suspect you've actually run into a real bug I may have introduced recently. I'm shocked nobody has complained about it on the mailing list if this is true. Give me a minute here.

@issa-tseng
Copy link
Member

Pull and try it again?

@jluis859
Copy link
Author

jluis859 commented Dec 1, 2011

after pull I have this:
OpenSSL::SSL::SSLError at /aggregate/post
SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol
file: http.rb location: connect line: 799
Backtrace:
http://pastebin.com/z5wa7ZAc

aggregate_instance_name
"172.30.1.196:8080/ODKAggregate"

@issa-tseng
Copy link
Member

The Aggregate bridge is currently broken and will be replaced with a simpler method soon. I'm gonna close this as that was the final outstanding issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants