rails-sqlserver / tiny_tds

TinyTDS - Simple and fast FreeTDS bindings for Ruby using DB-Library.
Other
607 stars 189 forks source link

argument out of range for datetime fields on linux (similar to issue #55) #58

Closed gardwired closed 12 years ago

gardwired commented 12 years ago

hi, i am running into this same issue as #55, but on debian linux ruby 1.8.7p320, tiny_tds 0.5.0 and freetds 0.91 qyering against windows 2000/sqlserver 2000 virtual machine (vmware). ie ruby is all on linux. i was getting these "statement invalid...argument out of range" errors on any query that has a datetime field (so almost all of my queries fail because of updated_at/created_at). this is a real show stopper. am really wanting to dump odbc. other details are that i compiled freetds without odbc, default tds 7.1 and enabling ms libs. the install all seemed to go fine (debian lenny doesnt have freetds 0.91 as yet).

i was getting the errors in rails 2.3.14 console so i then tried using TinyTds.client directly. same issue (argument out of range) when i try to iterate through result. fine if i dont select datetime fields.

please advise. am willing to help debug if needed. again, this doesn't appear to me to be a windows issue as these queries run fine on mssql query analyzer. it is only when you try to actually read the field in tds (convert string to Time?) that i pukes. i am not (and would prefer not to) use /etc/freetds/freetds.conf unless i have to to get this to work.

any ideas?

gardwired commented 12 years ago

update. i uninstalled my gem compiled against freetds 0.91 (my new /usr/local) and installed the gem again using my debian freetds package 0.82-4 and it seems to work now. i removed my existing freetds.conf and even tried setting dates prior to 1970 all seems fine now. i guess i am confused about whether with sqlserver 2000 i should be trying to use freetds 0.91 (it seems like that is what the docs urge you to do). what am i missing by using 0.82? i looked through freetds changelog for 0.91, but it is raw commits so a bit hard to follow. really just looking for any major gotchas or other bugaboos i should be aware of.

thanks again for all your hard work on this.

gardwired commented 12 years ago

ps since i have an older legacy stack, any advice about config for utf8 and tds ver would be appreciated.

metaskills commented 12 years ago

Maybe it is just me, but there seems to be a ton of wild information and some of it contracting that makes your support request really confusing to follow along. Let me start off with some basics.

First, your issue is most likely related to a simple issue with how TinyTDS parses date/time structures. The previous ticket #55 related to windows because the C code we have written ties to be compatibility to older version of Ruby and in some cases specific platforms like Windows in what the native Ruby C types will hold for DateTime/Time classes in ruby core. This is compound too when you consider 32/64 bit version. It is why this test looks so crazy.

https://github.com/rails-sqlserver/tiny_tds/blob/master/test/schema_test.rb#L41

Now, your issue is not likely directly related to this one. There are some cases where you will see "out of range" errors. Because of a configuration problem. FreeTDS has this crazy notion of --enable-msdblib or --enable-sybase-compat flags for configuring. Many people are confused by what these are for. Then think they have to set these config arguments for FreeTDS to work with their database. This common misconception is one reason I wrote the "FreeTDS Compatibility & Configuration" in the project's README. Take a look over that and these.

http://www.freetds.org/userguide/config.htm https://github.com/rails-sqlserver/tiny_tds/blob/master/ext/tiny_tds/tiny_tds_ext.h#L4-5

TL;DR is that these have nothing to do with what people think and are only of concern to C interfaces and how the client, in this case TinyTDS wants C structures for said date/time values returned. But since we define our own compatibility in our headers. It is moot. No matter how people configure FreeTDS, it should be fine because of our headers. So we used to see errors like "out of range" when people configured FreeTDS one way and we did not be explicit on how we needed the values from the C structures and we were passing months to days and days to months to ruby. Long story that should not be the case now.

So... looking thru your comments I am not getting what you have done, you say you have used both 0.91 and 0.82-4 in the same sentence. Both should work fine, tho 0.91 is recommended. It allows us to use :host/:port correctly and I have bug fixes in 0.91 that allows us to work with azure too.

About your last questions, I use TinyTDS with a legacy stack too. Should be just fine. As the docs say, I test in ton everything from 2000 to Azure. If you have your datatypes on SQL Server set to some national/unicode type (like nvarchar) and you have FreeTDS compiled with libiconv and you do not trump our default UTF8 encoding, then you should get good results. Did you read the notes I made about tis version in ""FreeTDS Compatibility & Configuration" in the README?

metaskills commented 12 years ago

You could also have a problem in your distribution of FreeTDS, I have no idea what 0.82-4 is. To give yourself a little more to go on, you can always run the tests. Our README covers how simple it is get the test running using a local only version of FreeTDS and libiconv. Basically a rake command and all is done for you. So read the "Development & Testing" section. That will download the released FreeTDS 0.91, compile and run the tests.

We even allow you to test the official patched level of 0.82 too using the TINYTDS_FREETDS_082 env var.

https://github.com/rails-sqlserver/tiny_tds/blob/master/tasks/ports.rake#L9

gardwired commented 12 years ago

hmmm. i thought i was being clear. if not, then i apologize. i am reporting what appears to be either a bug or a configuration issue on my end. to clarify how i got the error:

1) freetds 0.82-4 is just debian's package version for freetds 0.82. 2) when i run tinytds 0.5.0 against freetds 0.91 it gives me out of range errors when i have datetime fields in the query. 3) i compiled freetds with the following options: ./configure --prefix=/usr/local/lib/freetds/0.91 --with-tdsver=7.1 --disable-odbc --enable-msdblib make; make install; make clean 4) i installed the tiny_tds gem like so: gem install tiny_tds -- --with-freetds-dir=/usr/local/libfreetds/0.91 5) i checked the gem's mkmf file to verify that it compiled against 0.91. 6) when i run queries either using activerecord-sqlserver-adapter 2.3.14 or tiny tds directly, i get out of range error.

will take a look at running test and your other suggestions.

metaskills commented 12 years ago

Tho it should not make a difference, can you remove --enable-msdblib that config is not needed. Please do followup and see if local FreeTDS as downloaded by miniportile and rake-compiler pass the tests. I'd like to find out if this is a debian package issue or not.

gardwired commented 12 years ago

i read through all of the relevant pages from freetds.org, activerecord-sqlserver-adapter github pages, and the various pages on your github. i paid partcular attention to your page which is why i started by compiling 0.91 because it seems to indicate that that is the current preferred version and we will be upgrading to rails3 at some point (but not that soon).

i tried this install twice. once with freetds 0.91 -- no joy. and now with 0.82 which does seem to work. i would like to use the more recent 0.91 code.

some questions:

1) should i be using freetds.conf. i currently just have my db params set in database.yml for rails. but i saw the notes that you are having issues passing tds ver. when using odbc we set the following in freetds.conf

[global] tds version = 8.0 client charset = UTF-8 text size = 99999

is this the only place i can set tds version with tiny_tds? i get it that if using the new 0.91 i should set tds ver to 7.1 but with the older version 0.82 is is 8.0.

i will play around with the 0.91 with freetds.conf. so, i have tried tiny_tds with two different versions and had issues with 0.91.

metaskills commented 12 years ago

A freetds.conf file is the root of all evil and from my perspective, overly configured values and bug repots. With FreeTDS 0.91, you can totally ignore a freetds.conf file and use all the settings by passing them down to the client TinyTds::Client when connecting, which is what database.yml does. Everything in your example above is just not needed. Heck, we even have recent 2.3/3.0/3.1 adapter patches that allow you to set the text size too, see #configure_connection docs. I suspect if you get rid of it and the tds version then you will be much happier.

gardwired commented 12 years ago

ok will give it another whirl and post back later...gg

gardwired commented 12 years ago

hey, haven't forgotten about this. got hung up at work. i should be able to try later tonight....gg

gardwired commented 12 years ago

ok. i recompiled freetds 0.91 two different times and reinstalled the gem with the --with-freetds-dir option pointint to my /usr/local/freetds/0.91 install. i removed the --enable-msdblib first. same result. the second time i also remove the ---with-tdsver also same. here is the stack trace:

ActiveRecord::StatementInvalid: ArgumentError: argument out of range: SELECT * FROM [practitioner] WHERE ([practitioner].[userkey] = 538) from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract_adapter.rb:227:in log' from /usr/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-2.3.24/lib/active_record/connection_adapters/sqlserver_adapter.rb:1004:inraw_select' from /usr/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-2.3.24/lib/active_record/connection_adapters/sqlserver_adapter.rb:965:in select' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/database_statements.rb:7:inselect_all_without_query_cache' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/query_cache.rb:62:in select_all' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:665:infind_by_sql' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:1582:in find_every' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:1617:infind_one' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:1603:in find_from_ids' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:620:infind_without_org_scope' from /var/vhosts/ggard/app/models/abstract_database.rb:114:in find' from /var/vhosts/ggard/app/models/abstract_database.rb:120:incall' from /var/vhosts/ggard/app/models/abstract_database.rb:120:in `find'

2) as to debian packages for freetds, debian only has 0.82 available as a package (0.91 not even in unstable as yet). so that is why i am compiling 0.91 rather than using a debian package. unfortunately, it doesn't seem to be a package requirement that they document the exact configuration options that they used to compile the package so it is hard to know how they compiled their 0.82 package

3) at this point, i can use tiny_tds with the debian 0.82 package and all seems to work, but i am concerned about using the older code, particularly around encoding and other bugs with the newer AR adapter.

4) i dont have time right now but i will try the download portal and tests later tonight.

gardwired commented 12 years ago

ps how do i pass tdsver in database.yml for rails.

gardwired commented 12 years ago

correction, now 0.82 not working either. same error now as with 0.91. out of range error against sqlserver 2000.

gardwired commented 12 years ago

works fine if i get rid of the datetime fields in the query. obviously, not a solution.

metaskills commented 12 years ago

1) Do no worry about tds_version, the default for TinyTDS will work fine for anything from 2000 to Azure.

2) I have not seen anything about making your env more simple. In fact, your compiling FreeTDS 0.91 out side of a test setup, still using conf files and perhaps some ENV vars. I have a gut feeling (could be wrong) that your are playing with too many switches and getting things messed up.

3) To that end, could you please do the testing that I talked about from a git repo check which downloads and compiles local project versions of FreeTDS/libiconv. Just please follow the directions on the README and let me know what passes fails, etc. Anything else is just really not helpful to me nor to you as I can not isolate your problem. Please, when doing this step, remove any freetds.conf files that may be in a standard place (usr/etc ~/.freetds, env setting) and unset any environment vars that may affect the current shell your running the tests in. This could be FREETDS, TDSVER, etc. Once you do this for the default 0.91 and report back to me, I can start to help. Thanks!

gardwired commented 12 years ago

ok downloaded the repo and installed letting it pull in the remote freetds and iconv. i get "incorrect syntax near geometry" all over the place for the tests when i run: TINYTDS_UNIT_HOST=db9 rake

1) Error: test_0001_cast_nvarcharmax(Casting SQL Server schema::for 2005 and up): TinyTds::Error: Line 90: Incorrect syntax near 'geometry:'. ./test/test_helper.rb:143:in cancel' ./test/test_helper.rb:143:inload_current_schema' ./test/schema_test.rb:9 /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/spec.rb:177:in instance_eval' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/spec.rb:177:insetup' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:842:in run' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:683:in_run_suite' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:676:in map' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:676:in_run_suite' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:666:in _run_suites' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:666:inmap' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:666:in _run_suites' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:642:in_run_anything' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:804:in run_tests' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:791:insend' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:791:in _run' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:790:ineach' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:790:in _run' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:779:inrun' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:560:in `autorun' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5

gardwired commented 12 years ago

94 tests, 37 assertions, 0 failures, 78 errors, 1 skips rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ru...]

gardwired commented 12 years ago

all the errors are the about incorrect syntax near geometry.

gardwired commented 12 years ago

made sure that freetds.conf was moved out when ran rake test. there shouldnt be any other switches for your test right? i confess that we do have odbc, a packaged freetds, and my /usr/local/lib version of freetds on the system. this is on a development/utility server that does lots of things so i am reluctant to remove all that. can we solve the geometry issue first so that we can see the test results?

gardwired commented 12 years ago

am knocking off for the day. back later this afternoon.

metaskills commented 12 years ago

If you are on 2000, you forgot to specify the TINYTDS_SCHEMA=sqlserver_2000

gardwired commented 12 years ago

TINYTDS_UNIT_HOST=cp9vm TINYTDS_SCHEMA=sqlserver_2000 rake test (in /usr/src/tiny_tds) rake-compiler must be configured first to enable cross-compilation /usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/client_test.rb" "test/result_test.rb" "test/schema_test.rb" Run options: --seed 23360

Running tests:

...F..F.F.......E..FFF.F.........E.....F...S..........F........F..F....................F

Finished tests in 9.125166s, 9.6437 tests/s, 30.3556 assertions/s.

1) Failure: test_0011_cast_nchar(Casting SQL Server schema::for shared types) [./test/schema_test.rb:150]: Expected "123456\303\245\303\245 ", not "123456\303\245\303\245".

2) Failure: test_0006_cast_decimal(Casting SQL Server schema::for shared types) [./test/schema_test.rb:116]: Expected 12345.01 to be an instance of BigDecimal, not Float.

3) Failure: test_0003_cast_bit(Casting SQL Server schema::for shared types) [./test/schema_test.rb:31]: Expected nil, not false.

4) Error: test_0012_cast_ntext(Casting SQL Server schema::for shared types): TinyTds::Error: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. ./test/test_helper.rb:173:in each' ./test/test_helper.rb:173:infind_value' ./test/schema_test.rb:155:in test_0012_cast_ntext' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:843:insend' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:843:in run' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:683:in_run_suite' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:676:in map' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:676:in_run_suite' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:666:in _run_suites' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:666:inmap' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:666:in _run_suites' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:642:in_run_anything' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:804:in run_tests' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:791:insend' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:791:in _run' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:790:ineach' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:790:in _run' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:779:inrun' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:560:in `autorun' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5

5) Failure: test_0005_cast_datetime(Casting SQL Server schema::for shared types) [./test/schema_test.rb:83]: Expected 1, not 31.

6) Failure: test_0021_cast_uniqueidentifier(Casting SQL Server schema::for shared types) [./test/schema_test.rb:258]: Expected /\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/ to match "\234\035\370\257?H0A\225\260\243\260-\250\227\223".

7) Failure: test_0013_cast_numeric(Casting SQL Server schema::for shared types) [./test/schema_test.rb:165]: Expected 191.0 to be an instance of BigDecimal, not Float.

8) Failure: test_0016_cast_smalldatetime(Casting SQL Server schema::for shared types) [./test/schema_test.rb:215]: Expected 1, not 31.

9) Error: test_0007_error_gracefully_with_incorrect_syntax_in_sp_executesql(Basic query and result::when shit happens): TinyTds::Error: Attempt to initiate a new Adaptive Server operation with results pending ./test/result_test.rb:646:in execute' ./test/result_test.rb:646:inassert_followup_query' ./test/result_test.rb:632:in test_0007_error_gracefully_with_incorrect_syntax_in_sp_executesql' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:843:insend' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:843:in run' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:683:in_run_suite' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:676:in map' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:676:in_run_suite' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:666:in _run_suites' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:666:inmap' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:666:in _run_suites' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:642:in_run_anything' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:804:in run_tests' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:791:insend' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:791:in _run' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:790:ineach' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:790:in _run' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:779:inrun' /usr/lib/ruby/gems/1.8/gems/minitest-2.1.0/lib/minitest/unit.rb:560:in `autorun' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5

10) Failure: test_0009_fail_miserably_with_unknown_encoding_option(With in-valid options) [./test/client_test.rb:150]: expected a TinyTds::Error but none happened

11) Skipped: test_0007_should_eventually_run_this_test_to_prove_we_account_for_dropped_connections(With in-valid options) [/usr/lib/ruby/gems/1.8/gems/mini_shoulda-0.3.0/lib/mini_shoulda/spec.rb:11]: Should eventually run this test to prove we account for dropped connections

12) Failure: test_0003_have_a_getters_for_the_tds_version_information_brittle_since_conf_takesprecedence(With valid credentials) [./test/client_test.rb:27]: Expected 9, not 4.

13) Failure: test_0015_delete_and_update_with_affected_rows_support_and_insert_with_identity_support_in_native_sql(Basic query and result) [./test/result_test.rb:132]: native is numeric(38,0) for SCOPE_IDENTITY() function. Expected 342.0 to be an instance of BigDecimal, not Float.

14) Failure: test_0018_have_an_insert_method_that_cancels_result_rows_and_returns_the_scope_identity_natively(Basic query and result) [./test/result_test.rb:174]: Expected 345.0, not 4644776920376934400.

15) Failure: test_0019_return_bigint_for_insert_when_needed(Basic query and result) [./test/result_test.rb:189]: Expected 9223372036854775805, not 4890909195324358656.

88 tests, 277 assertions, 12 failures, 2 errors, 1 skips rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ru...]

metaskills commented 12 years ago

Now we are getting somewhere, I just checked master, and all the tests pass under my SQL Server 2000 database in a quick check on ruby 1.8.7, 1.9.2, and 1.9.3. So why yours is not is the big question. Can you show me what you have in your conf file for cp9vm?

gardwired commented 12 years ago

conf file? i am not using freetds.conf. cp9vm is a windows2000 server vmware instance running sqlserver 2000. so cp9vm is just the host.

metaskills commented 12 years ago

Well, if you (1) have made sure that you are not setting any potential conflicting ivars SYBASE , TDSVER, FREETDS, etc http://www.freetds.org/userguide/envvar.htm or (2) you made sure that you compiled an official FreeTDS with the rake task and did not set TINYTDS_SKIP_PORTS... Then do you have any ideas why your SQL Server is failing?

All the failures to me look like they could be screwed up due to something crazy like from the above. Make sure you removed all that from the equation and see if you can look around to things like your DB version, some crazy DB configs, something? I'm at a loss.

gardwired commented 12 years ago

will rerun all of it and post back later. as for sqlserver it is just the basic stuff with no oddball collations or other ms wierdness.

gardwired commented 12 years ago

actually, we have a new datacenter stack that we are going to rollout relatively soon. i think i will try pulling all the odbc and other freetds stuff off of one of those servers. get it down to barebones and then run the gem testing from there. the sqlserver vm is the same. will let you know. might not be tonight tho.

metaskills commented 12 years ago

Thanks, you really should not be having problems like this :( but it will be good to find out and close the loop.

metaskills commented 12 years ago

Can you show me the output of this? Should show show the entire build and test process.

$ git clean -x -d -f
$ rake
gardwired commented 12 years ago

ok will do. in the meantime i successfully ran tests against my sqlserver2000 vm on a different machine. i uninstalled all odbc and tds related packages, rebooted, and then cloned the repo and ran tests. all tests ran ok with one skipped (test_007 about dropped connections -- looks like that is intentional to skip). to be clear this s what i did to get the clean install/tests after uninstalling stuff and creating tinytdstest db:

git clone ... cd tiny_tds bundle install TINYTDS_UNIT_HOST=dbhost TINYTDS_SCHEMA=sqlserver_2000 rake

going to try testing the gem with datetime fields now.

gardwired commented 12 years ago

i will keep tracking down my problem and post updates. just wondered though whether it makes sense to just statically compile freetds into the driver. i think i saw a posting about that somewhere related to tiny_tds. i am sure there are arguments against this, but, for me, given the crankiness and complexity of freetds, not sure we gain anything by having it be separate. just my opinion.

metaskills commented 12 years ago

We statically link FreeTDS and Iconv for the Windows gem platforms. Our usage of @luislavena's rake-compiler and miniportile make this real easy. In fact, the README of the project talks about how you can use these tools to compile a native platform gem for you own needs. It is just a few rake commands.

gardwired commented 12 years ago

should be able to post more updates on this over the next few days. just getting back to it.

gardwired commented 12 years ago

hi again,

so i did some housekeeping and removed files/packages that may have been causing tests to fail on the original machine. i then downloaded fresh git repo and ran mini portile tests. they passed finally. so good news.

i am now trying to complile a native gem so that i don't have to worry about having the right/different versions of freetds/iconv on all my other machines. sadly, i am getting the following errors:

gem install pkg/tiny_tds-0.5.1.rc1.gem -- --with-iconv-dir=/usr/src/tiny_tds_native/tmp/x86_64-linux/ports/libiconv/1.13.1/libiconv-1.13.1 --with-freetds-dir=/usr/src/tiny_tds_native/tmp/x86_64-linux/ports/freetds/0.91/freetds-0.91 --enable-iconv

i googled around and found issue #11 need to specify iconv path and the comments about linking iconv in debian breaking. this is on debian lenny so i tried the above with the --enable-icon. either way it never seems to be able to find the freetds/libiconv files that the portile installed in it's tmp folder. any ideas? i assumed that it would just work without the --with-dir options, but i got similar errors.

gem install pkg/tiny_tds-0.5.1.rc1.gem -- --with-iconv-dir=/usr/src/tiny_tds_native/tmp/x86_64-linux/ports/libiconv/1.13.1/libiconv-1.13.1 --with-freetds-dir=/usr/src/tiny_tds_native/tmp/x86_64-linux/ports/freetds/0.91/freetds-0.91 --enable-iconv Building native extensions. This could take a while... ERROR: Error installing pkg/tiny_tds-0.5.1.rc1.gem: ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb --with-iconv-dir=/usr/src/tiny_tds_native/tmp/x86_64-linux/ports/libiconv/1.13.1/libiconv-1.13.1 --with-freetds-dir=/usr/src/tiny_tds_native/tmp/x86_64-linux/ports/freetds/0.91/freetds-0.91 --enable-iconv looking for library directory /usr/local/lib ... yes checking for main() in -liconv... no looking for library directory /usr/local/lib/freetds ... no looking for library directory /usr/lib ... yes

checking for main() in -liconv... no

Can not find FreeTDS's db-lib or include directory.

* 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: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby1.8 --with-iconv-dir --with-iconv-include --without-iconv-include=${iconv-dir}/include --with-iconv-lib --without-iconv-lib=${iconv-dir}/lib --with-freetds-dir --with-freetds-include --without-freetds-include=${freetds-dir}/include --with-freetds-lib --without-freetds-lib=${freetds-dir}/lib --enable-lookup --disable-lookup --with-iconvlib --without-iconvlib --with-iconvlib --without-iconvlib looking for library directory /usr/lib/freetds ... no

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/tiny_tds-0.5.1.rc1 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/tiny_tds-0.5.1.rc1/ext/tiny_tds/gem_make.out

luislavena commented 12 years ago

i am now trying to complile a native gem so that i don't have to worry about having the right/different versions of freetds/iconv on all my other machines. sadly, i am getting the following errors: gem install pkg/tiny_tds-0.5.1.rc1.gem -- --with-iconv-dir=/usr/src/tiny_tds_native/tmp/x86_64-linux/ports/libiconv/1.13.1/libiconv-1.13.1 --with-freetds-dir=/usr/src/tiny_tds_native/tmp/x86_64-linux/ports/freetds/0.91/freetds-0.91 --enable-iconv

You should be using the native gem, not installing from the pure ruby one.

Please do rake native gem and check inside pkg directory, there should be two gem files, one is the one you're trying to install and the other one which contains the native and precompiled binaries.

For the record, you're pointing the gem installation process to the wrong directory, you should never use the tmp reference but instead the installed ports one instead, so:

gem install xxx -- --with-iconv-dir=/path/to/ports/platform/libiconv/X.Y.Z

Anyway, please use the generated binaries instead.

gardwired commented 12 years ago

ok in my pkg folder there is a .gem file and a directory that's it.

luislavena commented 12 years ago

ok in my pkg folder there is a .gem file and a directory that's it.

Did you execute rake native gem as mentioned before to generate the native version of the gem for your platform?

metaskills commented 12 years ago

You are trying to shoe horn in rules for installing a gem that just do not simply apply if your are building your own native gem. A few helpful pointers.

1) Remember the git clean -x -d -f command I had said above. That would have cleaned out the pkg directory too. A must command for getting a fresh clean repo.

2) Follow the directions for building your own native gem on the readme. Pay special attention to the gem your installing. In the commands above, your install a gem that is not for your platform. It says:

4) The native gem can be found in the pkg directory. The last command assumes "X" is version numbers and #{platform} will be your platform.

$ bundle install
$ rake compile
$ rake native gem
$ gem install pkg/tiny_tds-X.X.X-#{platform}.gem

3) Once a platform gem is build, you DO NOT NEED -- ARGS when installing it. You simply just do that last line above. Remember, the build gem will have freetds/iconv linked inside the tiny_tds binary as static libraries.

gardwired commented 12 years ago

i did EXACTLY what the directions for installing the native gem as they are specified on the readme.

rake compile rake native gem gem install pkg/tiny_tdsxxxx.gem

i just did this again and got the same errors. no free tds lib found.

note that when i run rake native gem it exits with the following error:

rm -f pkg/tiny_tds-0.5.1.rc1/test/test_helper.rb ln test/test_helper.rb pkg/tiny_tds-0.5.1.rc1/test/test_helper.rb rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/tiny_tds.so ln lib/tiny_tds/tiny_tds.so pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/tiny_tds.so WARNING: no rubyforge_project specified mv tiny_tds-0.5.1.rc1.gem pkg/tiny_tds-0.5.1.rc1.gem rake aborted! Don't know how to build task 'pkg/tiny_tds-0.5.1.rc1-x86_64-linux'

(See full trace by running task with --trace)

does that have anything to do with this?

luislavena commented 12 years ago

i did EXACTLY what the directions for installing the native gem as they are specified on the readme.

Seems not, you're omitting the information you provided now.

note that when i run rake native gem it exits with the following error: Don't know how to build task 'pkg/tiny_tds-0.5.1.rc1-x86_64-linux'

See Issue #53 which contains a resolution for the problem (tl;dr -- update RubyGems and build again)

metaskills commented 12 years ago

does that have anything to do with this?

Yes! It is pointless to continue till we find out that problem. I suggest using the --trace option. Also there is where @luislavena can help too if needed

gardwired commented 12 years ago

right. so did git -x -d -f and reran all this again. same inability to build the platform gem. looking into #53.

gardwired commented 12 years ago

so i do have gem -v = 1.3.7. will upgrade and try again. might be good to have a note in the readme on this.

luislavena commented 12 years ago

so i do have gem -v = 1.3.7. will upgrade and try again. might be good to have a note in the readme on this.

Indeed, opening an issue about that.

gardwired commented 12 years ago

sorry hit the wrong button to close.

another question. will this static gem still read /etc/freetds/freetds.conf i am hoping not. in my freetds.conf i have options:

tds version = 8.0 client charset = UTF-8 text size = 99999 encryption = off

i have other sites that are still using freetds 8.4 with odbc so i can't remove the freetds.conf file without breaking those. they will get converted to this new driver in short order but it'd be nice to test this driver a bit before forcing it on all of my dev sites.

gardwired commented 12 years ago

ok upgraded to gem 1.5.0 using

gem upgrade --system 1.5.0

did clean git clone and bundle install. now i get this:

rake compile /usr/bin/rake:19:in `load': no such file to load -- rake (LoadError) from /usr/bin/rake:19

gardwired commented 12 years ago

gem -v verfies as 1.5.0

gardwired commented 12 years ago

downgraded to gems 1.4.2 and now get same rake error. don't know how to build tiny_tds platform gem. i run rails 2.3.11 on some sites and redmine so i can't just upgrade to the current gem. is there a legacy gem version that you recommend?

gardwired commented 12 years ago

tried again with gem 1.4.0 with rake native gem --trace:

rake native gem --trace (in /usr/src/tiny_tds) rake-compiler must be configured first to enable cross-compilation * Invoke native (first_time) * Invoke native:x86_64-linux (first_time) * Invoke native:tiny_tds:x86_64-linux (first_time) * Invoke lib/tiny_tds/tiny_tds.so (first_time, not_needed) * Invoke copy:tiny_tds:x86_64-linux:1.8.7 (first_time) * Invoke lib/tiny_tds (first_time, not_needed) * Invoke tmp/x86_64-linux/tiny_tds/1.8.7/tiny_tds.so (first_time, not_needed) * Invoke tmp/x86_64-linux/tiny_tds/1.8.7/Makefile (first_time, not_needed) * Invoke tmp/x86_64-linux/tiny_tds/1.8.7 (first_time, not_needed) * Invoke ext/tiny_tds/extconf.rb (first_time, not_needed) * Invoke ext/tiny_tds/client.c (first_time, not_needed) * Invoke ext/tiny_tds/result.c (first_time, not_needed) * Invoke ext/tiny_tds/tiny_tds_ext.c (first_time, not_needed) * Execute copy:tiny_tds:x86_64-linux:1.8.7 install -c tmp/x86_64-linux/tiny_tds/1.8.7/tiny_tds.so lib/tiny_tds/tiny_tds.so * Execute native:tiny_tds:x86_64-linux * Execute native:x86_64-linux * Execute native * Invoke gem (first_time) * Invoke pkg/tiny_tds-0.5.1.rc1.gem (first_time) * Invoke pkg (first_time) * Execute pkg mkdir -p pkg * Invoke pkg/tiny_tds-0.5.1.rc1 (first_time) * Invoke .gitignore (first_time, not_needed) * Invoke CHANGELOG (first_time, not_needed) * Invoke Gemfile (first_time, not_needed) * Invoke MIT-LICENSE (first_time, not_needed) * Invoke NOTES (first_time, not_needed) * Invoke README.md (first_time, not_needed) * Invoke Rakefile (first_time, not_needed) * Invoke ext/tiny_tds/client.c (not_needed) * Invoke ext/tiny_tds/client.h (first_time, not_needed) * Invoke ext/tiny_tds/extconf.rb (not_needed) * Invoke ext/tiny_tds/result.c (not_needed) * Invoke ext/tiny_tds/result.h (first_time, not_needed) * Invoke ext/tiny_tds/tiny_tds_ext.c (not_needed) * Invoke ext/tiny_tds/tiny_tds_ext.h (first_time, not_needed) * Invoke lib/tiny_tds.rb (first_time, not_needed) * Invoke lib/tiny_tds/client.rb (first_time, not_needed) * Invoke lib/tiny_tds/error.rb (first_time, not_needed) * Invoke lib/tiny_tds/result.rb (first_time, not_needed) * Invoke lib/tiny_tds/version.rb (first_time, not_needed) * Invoke tasks/ports.rake (first_time, not_needed) * Invoke test/benchmark/query.rb (first_time, not_needed) * Invoke test/benchmark/query_odbc.rb (first_time, not_needed) * Invoke test/benchmark/query_tinytds.rb (first_time, not_needed) * Invoke test/client_test.rb (first_time, not_needed) * Invoke test/result_test.rb (first_time, not_needed) * Invoke test/schema/1px.gif (first_time, not_needed) * Invoke test/schema/sqlserver_2000.sql (first_time, not_needed) * Invoke test/schema/sqlserver_2005.sql (first_time, not_needed) * Invoke test/schema/sqlserver_2008.sql (first_time, not_needed) * Invoke test/schema/sqlserver_azure.sql (first_time, not_needed) * Invoke test/schema_test.rb (first_time, not_needed) * Invoke test/test_helper.rb (first_time, not_needed) * Invoke lib/tiny_tds/tiny_tds.so (not_needed) * Execute pkg/tiny_tds-0.5.1.rc1 mkdir -p pkg mkdir -p pkg/tiny_tds-0.5.1.rc1 rm -f pkg/tiny_tds-0.5.1.rc1/.gitignore ln .gitignore pkg/tiny_tds-0.5.1.rc1/.gitignore rm -f pkg/tiny_tds-0.5.1.rc1/CHANGELOG ln CHANGELOG pkg/tiny_tds-0.5.1.rc1/CHANGELOG rm -f pkg/tiny_tds-0.5.1.rc1/Gemfile ln Gemfile pkg/tiny_tds-0.5.1.rc1/Gemfile rm -f pkg/tiny_tds-0.5.1.rc1/MIT-LICENSE ln MIT-LICENSE pkg/tiny_tds-0.5.1.rc1/MIT-LICENSE rm -f pkg/tiny_tds-0.5.1.rc1/NOTES ln NOTES pkg/tiny_tds-0.5.1.rc1/NOTES rm -f pkg/tiny_tds-0.5.1.rc1/README.md ln README.md pkg/tiny_tds-0.5.1.rc1/README.md rm -f pkg/tiny_tds-0.5.1.rc1/Rakefile ln Rakefile pkg/tiny_tds-0.5.1.rc1/Rakefile mkdir -p pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/client.c ln ext/tiny_tds/client.c pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/client.c rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/client.h ln ext/tiny_tds/client.h pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/client.h rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/extconf.rb ln ext/tiny_tds/extconf.rb pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/extconf.rb rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/result.c ln ext/tiny_tds/result.c pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/result.c rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/result.h ln ext/tiny_tds/result.h pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/result.h rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/tiny_tds_ext.c ln ext/tiny_tds/tiny_tds_ext.c pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/tiny_tds_ext.c rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/tiny_tds_ext.h ln ext/tiny_tds/tiny_tds_ext.h pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/tiny_tds_ext.h mkdir -p pkg/tiny_tds-0.5.1.rc1/lib rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds.rb ln lib/tiny_tds.rb pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds.rb mkdir -p pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/client.rb ln lib/tiny_tds/client.rb pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/client.rb rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/error.rb ln lib/tiny_tds/error.rb pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/error.rb rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/result.rb ln lib/tiny_tds/result.rb pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/result.rb rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/version.rb ln lib/tiny_tds/version.rb pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/version.rb mkdir -p pkg/tiny_tds-0.5.1.rc1/tasks rm -f pkg/tiny_tds-0.5.1.rc1/tasks/ports.rake ln tasks/ports.rake pkg/tiny_tds-0.5.1.rc1/tasks/ports.rake mkdir -p pkg/tiny_tds-0.5.1.rc1/test/benchmark rm -f pkg/tiny_tds-0.5.1.rc1/test/benchmark/query.rb ln test/benchmark/query.rb pkg/tiny_tds-0.5.1.rc1/test/benchmark/query.rb rm -f pkg/tiny_tds-0.5.1.rc1/test/benchmark/query_odbc.rb ln test/benchmark/query_odbc.rb pkg/tiny_tds-0.5.1.rc1/test/benchmark/query_odbc.rb rm -f pkg/tiny_tds-0.5.1.rc1/test/benchmark/query_tinytds.rb ln test/benchmark/query_tinytds.rb pkg/tiny_tds-0.5.1.rc1/test/benchmark/query_tinytds.rb rm -f pkg/tiny_tds-0.5.1.rc1/test/client_test.rb ln test/client_test.rb pkg/tiny_tds-0.5.1.rc1/test/client_test.rb rm -f pkg/tiny_tds-0.5.1.rc1/test/result_test.rb ln test/result_test.rb pkg/tiny_tds-0.5.1.rc1/test/result_test.rb mkdir -p pkg/tiny_tds-0.5.1.rc1/test/schema rm -f pkg/tiny_tds-0.5.1.rc1/test/schema/1px.gif ln test/schema/1px.gif pkg/tiny_tds-0.5.1.rc1/test/schema/1px.gif rm -f pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2000.sql ln test/schema/sqlserver_2000.sql pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2000.sql rm -f pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2005.sql ln test/schema/sqlserver_2005.sql pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2005.sql rm -f pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2008.sql ln test/schema/sqlserver_2008.sql pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2008.sql rm -f pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_azure.sql ln test/schema/sqlserver_azure.sql pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_azure.sql rm -f pkg/tiny_tds-0.5.1.rc1/test/schema_test.rb ln test/schema_test.rb pkg/tiny_tds-0.5.1.rc1/test/schema_test.rb rm -f pkg/tiny_tds-0.5.1.rc1/test/test_helper.rb ln test/test_helper.rb pkg/tiny_tds-0.5.1.rc1/test/test_helper.rb mkdir -p pkg rm -f pkg/tiny_tds-0.5.1.rc1/.gitignore ln .gitignore pkg/tiny_tds-0.5.1.rc1/.gitignore rm -f pkg/tiny_tds-0.5.1.rc1/CHANGELOG ln CHANGELOG pkg/tiny_tds-0.5.1.rc1/CHANGELOG rm -f pkg/tiny_tds-0.5.1.rc1/Gemfile ln Gemfile pkg/tiny_tds-0.5.1.rc1/Gemfile rm -f pkg/tiny_tds-0.5.1.rc1/MIT-LICENSE ln MIT-LICENSE pkg/tiny_tds-0.5.1.rc1/MIT-LICENSE rm -f pkg/tiny_tds-0.5.1.rc1/NOTES ln NOTES pkg/tiny_tds-0.5.1.rc1/NOTES rm -f pkg/tiny_tds-0.5.1.rc1/README.md ln README.md pkg/tiny_tds-0.5.1.rc1/README.md rm -f pkg/tiny_tds-0.5.1.rc1/Rakefile ln Rakefile pkg/tiny_tds-0.5.1.rc1/Rakefile rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/client.c ln ext/tiny_tds/client.c pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/client.c rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/client.h ln ext/tiny_tds/client.h pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/client.h rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/extconf.rb ln ext/tiny_tds/extconf.rb pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/extconf.rb rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/result.c ln ext/tiny_tds/result.c pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/result.c rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/result.h ln ext/tiny_tds/result.h pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/result.h rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/tiny_tds_ext.c ln ext/tiny_tds/tiny_tds_ext.c pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/tiny_tds_ext.c rm -f pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/tiny_tds_ext.h ln ext/tiny_tds/tiny_tds_ext.h pkg/tiny_tds-0.5.1.rc1/ext/tiny_tds/tiny_tds_ext.h rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds.rb ln lib/tiny_tds.rb pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds.rb rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/client.rb ln lib/tiny_tds/client.rb pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/client.rb rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/error.rb ln lib/tiny_tds/error.rb pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/error.rb rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/result.rb ln lib/tiny_tds/result.rb pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/result.rb rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/version.rb ln lib/tiny_tds/version.rb pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/version.rb rm -f pkg/tiny_tds-0.5.1.rc1/tasks/ports.rake ln tasks/ports.rake pkg/tiny_tds-0.5.1.rc1/tasks/ports.rake rm -f pkg/tiny_tds-0.5.1.rc1/test/benchmark/query.rb ln test/benchmark/query.rb pkg/tiny_tds-0.5.1.rc1/test/benchmark/query.rb rm -f pkg/tiny_tds-0.5.1.rc1/test/benchmark/query_odbc.rb ln test/benchmark/query_odbc.rb pkg/tiny_tds-0.5.1.rc1/test/benchmark/query_odbc.rb rm -f pkg/tiny_tds-0.5.1.rc1/test/benchmark/query_tinytds.rb ln test/benchmark/query_tinytds.rb pkg/tiny_tds-0.5.1.rc1/test/benchmark/query_tinytds.rb rm -f pkg/tiny_tds-0.5.1.rc1/test/client_test.rb ln test/client_test.rb pkg/tiny_tds-0.5.1.rc1/test/client_test.rb rm -f pkg/tiny_tds-0.5.1.rc1/test/result_test.rb ln test/result_test.rb pkg/tiny_tds-0.5.1.rc1/test/result_test.rb rm -f pkg/tiny_tds-0.5.1.rc1/test/schema/1px.gif ln test/schema/1px.gif pkg/tiny_tds-0.5.1.rc1/test/schema/1px.gif rm -f pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2000.sql ln test/schema/sqlserver_2000.sql pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2000.sql rm -f pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2005.sql ln test/schema/sqlserver_2005.sql pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2005.sql rm -f pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2008.sql ln test/schema/sqlserver_2008.sql pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_2008.sql rm -f pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_azure.sql ln test/schema/sqlserver_azure.sql pkg/tiny_tds-0.5.1.rc1/test/schema/sqlserver_azure.sql rm -f pkg/tiny_tds-0.5.1.rc1/test/schema_test.rb ln test/schema_test.rb pkg/tiny_tds-0.5.1.rc1/test/schema_test.rb rm -f pkg/tiny_tds-0.5.1.rc1/test/test_helper.rb ln test/test_helper.rb pkg/tiny_tds-0.5.1.rc1/test/test_helper.rb rm -f pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/tiny_tds.so ln lib/tiny_tds/tiny_tds.so pkg/tiny_tds-0.5.1.rc1/lib/tiny_tds/tiny_tds.so * Invoke .gitignore (not_needed) * Invoke CHANGELOG (not_needed) * Invoke Gemfile (not_needed) * Invoke MIT-LICENSE (not_needed) * Invoke NOTES (not_needed) * Invoke README.md (not_needed) * Invoke Rakefile (not_needed) * Invoke ext/tiny_tds/client.c (not_needed) * Invoke ext/tiny_tds/client.h (not_needed) * Invoke ext/tiny_tds/extconf.rb (not_needed) * Invoke ext/tiny_tds/result.c (not_needed) * Invoke ext/tiny_tds/result.h (not_needed) * Invoke ext/tiny_tds/tiny_tds_ext.c (not_needed) * Invoke ext/tiny_tds/tiny_tds_ext.h (not_needed) * Invoke lib/tiny_tds.rb (not_needed) * Invoke lib/tiny_tds/client.rb (not_needed) * Invoke lib/tiny_tds/error.rb (not_needed) * Invoke lib/tiny_tds/result.rb (not_needed) * Invoke lib/tiny_tds/version.rb (not_needed) * Invoke tasks/ports.rake (not_needed) * Invoke test/benchmark/query.rb (not_needed) * Invoke test/benchmark/query_odbc.rb (not_needed) * Invoke test/benchmark/query_tinytds.rb (not_needed) * Invoke test/client_test.rb (not_needed) * Invoke test/result_test.rb (not_needed) * Invoke test/schema/1px.gif (not_needed) * Invoke test/schema/sqlserver_2000.sql (not_needed) * Invoke test/schema/sqlserver_2005.sql (not_needed) * Invoke test/schema/sqlserver_2008.sql (not_needed) * Invoke test/schema/sqlserver_azure.sql (not_needed) * Invoke test/schema_test.rb (not_needed) * Invoke test/test_helper.rb (not_needed) * Execute pkg/tiny_tds-0.5.1.rc1.gem cd pkg/tiny_tds-0.5.1.rc1 Successfully built RubyGem Name: tiny_tds Version: 0.5.1.rc1 File: tiny_tds-0.5.1.rc1.gem mv tiny_tds-0.5.1.rc1.gem .. cd - * Invoke pkg/tiny_tds-0.5.1.rc1-x86_64-linux.gem (first_time) \ Invoke pkg (not_needed) rake aborted! Don't know how to build task 'pkg/tiny_tds-0.5.1.rc1-x86_64-linux' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1728:in []' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:605:ininvoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:ininvoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:insynchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:ininvoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:ininvoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:insynchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:ininvoke' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in invoke_task' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:intop_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:inload' /usr/bin/rake:19

gardwired commented 12 years ago

ps here is the git clean and rake compile that i did immediately before the above native gem call.

git clean -x -d -f Removing Gemfile.lock Removing lib/tiny_tds/tiny_tds.so Removing pkg/ Removing ports/ Removing tmp/ root@cp8:/usr/src/tiny_tds# rake compile --trace (in /usr/src/tiny_tds) rake-compiler must be configured first to enable cross-compilation * Invoke compile (first_time) * Invoke ports:freetds (first_time) * Invoke ports (first_time) * Execute ports mkdir -p ports * Invoke ports:libiconv (first_time) * Invoke ports (not_needed) * Execute ports:libiconv Downloading libiconv-1.13.1.tar.gz (100%) Extracting libiconv-1.13.1.tar.gz into tmp/x86_64-linux/ports/libiconv/1.13.1... OK Running 'configure' for libiconv 1.13.1... OK Running 'compile' for libiconv 1.13.1... OK Running 'install' for libiconv 1.13.1... OK touch ports/.libiconv.1.13.1.x86_64-linux.timestamp Activating libiconv 1.13.1 (from ports/x86_64-linux/libiconv/1.13.1)... * Execute ports:freetds Downloading freetds-0.91.tar.gz (100%) Extracting freetds-0.91.tar.gz into tmp/x86_64-linux/ports/freetds/0.91... OK Running 'configure' for freetds 0.91... OK Running 'compile' for freetds 0.91... OK Running 'install' for freetds 0.91... OK touch ports/.freetds.0.91.x86_64-linux.timestamp Activating freetds 0.91 (from ports/x86_64-linux/freetds/0.91)... * Invoke compile:x86_64-linux (first_time) * Invoke compile:tiny_tds:x86_64-linux (first_time) * Invoke copy:tiny_tds:x86_64-linux:1.8.7 (first_time) * Invoke lib/tiny_tds (first_time, not_needed) * Invoke tmp/x86_64-linux/tiny_tds/1.8.7/tiny_tds.so (first_time) * Invoke tmp/x86_64-linux/tiny_tds/1.8.7/Makefile (first_time) * Invoke tmp/x86_64-linux/tiny_tds/1.8.7 (first_time) * Execute tmp/x86_64-linux/tiny_tds/1.8.7 mkdir -p tmp/x86_64-linux/tiny_tds/1.8.7 * Invoke ext/tiny_tds/extconf.rb (first_time, not_needed) * Execute tmp/x86_64-linux/tiny_tds/1.8.7/Makefile cd tmp/x86_64-linux/tiny_tds/1.8.7 /usr/bin/ruby1.8 -I. ../../../../ext/tiny_tds/extconf.rb looking for library directory /usr/src/tiny_tds/ports/x86_64-linux/freetds/0.91/lib ... yes checking for main() in -liconv... yes checking for main() in -lsybdb... yes looking for include directory /usr/src/tiny_tds/ports/x86_64-linux/freetds/0.91/include ... yes checking for sybfront.h... yes checking for sybdb.h... yes creating Makefile cd - * Invoke ext/tiny_tds/client.c (first_time, not_needed) * Invoke ext/tiny_tds/result.c (first_time, not_needed) * Invoke ext/tiny_tds/tiny_tds_ext.c (first_time, not_needed) * Execute tmp/x86_64-linux/tiny_tds/1.8.7/tiny_tds.so cd tmp/x86_64-linux/tiny_tds/1.8.7 make cc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I../../../../ext/tiny_tds -DHAVE_SYBFRONT_H -DHAVE_SYBDB_H -I/usr/src/tiny_tds/ports/x86_64-linux/freetds/0.91/include -I/usr/src/tiny_tds/ports/x86_64-linux/freetds/0.91/include -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c ../../../../ext/tiny_tds/client.c cc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I../../../../ext/tiny_tds -DHAVE_SYBFRONT_H -DHAVE_SYBDB_H -I/usr/src/tiny_tds/ports/x86_64-linux/freetds/0.91/include -I/usr/src/tiny_tds/ports/x86_64-linux/freetds/0.91/include -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c ../../../../ext/tiny_tds/result.c cc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I../../../../ext/tiny_tds -DHAVE_SYBFRONT_H -DHAVE_SYBDB_H -I/usr/src/tiny_tds/ports/x86_64-linux/freetds/0.91/include -I/usr/src/tiny_tds/ports/x86_64-linux/freetds/0.91/include -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c ../../../../ext/tiny_tds/tiny_tds_ext.c cc -shared -o tiny_tds.so client.o result.o tiny_tds_ext.o -L. -L/usr/lib -L/usr/src/tiny_tds/ports/x86_64-linux/freetds/0.91/lib -L. -rdynamic -Wl,-export-dynamic -L/usr/src/tiny_tds/ports/x86_64-linux/freetds/0.91/lib -lruby1.8 -lsybdb -liconv -lpthread -lrt -ldl -lcrypt -lm -lc cd - * Execute copy:tiny_tds:x86_64-linux:1.8.7 install -c tmp/x86_64-linux/tiny_tds/1.8.7/tiny_tds.so lib/tiny_tds/tiny_tds.so * Execute compile:tiny_tds:x86_64-linux * Execute compile:x86_64-linux * Execute compile