3

Let me start by saying I'm not a Ruby dev. I'm just trying to install Redmine on Windows x64. I've found similar questions here which I will link later. But since I'm not a Ruby dev, I don't understand the answers and can't apply them to my situation. So please be a little verbose in your answer so that I can fully understand what I'm doing.

I get to Step 5 in the the Redmine Install and the following error is generated:

C:\redmine\redmine-3.2.3>bundle exec rake generate_secret_token
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"
rake aborted!
LoadError: cannot load such file -- tiny_tds/tiny_tds
C:/redmine/redmine-3.2.3/config/application.rb:5:in `<top (required)>'
C:/redmine/redmine-3.2.3/Rakefile:5:in `require'
C:/redmine/redmine-3.2.3/Rakefile:5:in `<top (required)>'
LoadError: cannot load such file -- tiny_tds/2.2/tiny_tds
C:/redmine/redmine-3.2.3/config/application.rb:5:in `<top (required)>'
C:/redmine/redmine-3.2.3/Rakefile:5:in `require'
C:/redmine/redmine-3.2.3/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)

Looking at this answer and this answer, I see that looking at Redmine's Gemfile and my list of gems should provide some insight as to the problem.

The problem seems to be with tiny_tds and the only place it is mentioned in the Gemfile is here:

when /sqlserver/
  gem "tiny_tds", "~> 0.6.2", :platforms => [:mri, :mingw, :x64_mingw]
  gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw, :x64_mingw]

From my gem list:

rake (11.2.2, default: 10.4.2)
tiny_tds (1.0.4, 0.6.2 x64-mingw32)

It looks to me that I have multiple versions of rake and tiny_tds installed and it is choosing the wrong ones. One of the answers linked above seems to suggest that the Gemfile needs to be edited to pick the correct version and the other seems to suggest that using bundle exec should take care of this for me.

So what do I need to do here to complete this installation?

Community
  • 1
  • 1
embedded.kyle
  • 10,976
  • 5
  • 37
  • 56
  • It's possible that `when` block isn't properly engaged. – tadman Jun 20 '16 at 17:51
  • @tadman As I said, I'm not a Ruby dev and don't fully understand the lingo specific to the language. Could you restate and expand upon your comment in generic language? Or use an analogy to C/VB/Python/Java? – embedded.kyle Jun 20 '16 at 18:39
  • Ruby's gem system at its lowest level just deploys a series of Ruby files into particular directories, and the `gem` directive tells Ruby to add that to the `$LOAD_PATH` where it searches for dependencies like `tiny_tds/tiny_tds`. If for some reason your Gemfile isn't loading properly, that might not be added to your search path. Try moving the `tiny_tds` dependency out of that `when` block to force it to load. – tadman Jun 20 '16 at 18:43
  • @tadman I moved that line outside of all the `if`s and `case`s so there shouldn't have been any conditionals that might cause it not to load. I then reran the `bundle exec rake generate_secret_token` line and received the same error. Is there something else I should be doing before `bundle exec rake` to make sure it accepted my changes? – embedded.kyle Jun 20 '16 at 19:17

3 Answers3

0

I had this problem (completely new to webdev) but after searching around, I got everything to work by running the following commands

gem install tiny_tds 

# Run these next commands within the tiny_tds directory.

# Now install the dependencies (Requires bundler)
bundle install 

# Now compile the gem. (Requires docker toolbox)
rake gem:windows

Here is the link to the part of the tiny_tds readme where he goes over windows installation. Hope this helps.

0

It has been a long time but there may be someone like me still need a solution that works for me for windows server 2012.

I have found the solution from tiny_tds git page by installing the .gem suggested @coderjoe.

  1. download the gem from google drive
  2. install it by --local, for my 64bit system x86 versions works

    gem install --local .\tiny_tds-1.1.0-x86-mingw32.gem

    see the logs:

    PS C:\Users\mesut.gunes\Downloads> gem install --local .\tiny_tds-1.1.0-x64-mingw32.gem
    The system cannot find the path specified.
    Successfully installed tiny_tds-1.1.0-x64-mingw32
    Parsing documentation for tiny_tds-1.1.0-x64-mingw32
    Installing ri documentation for tiny_tds-1.1.0-x64-mingw32
    Done installing documentation for tiny_tds after 0 seconds
    1 gem installed
    PS C:\Users\mesut.gunes\Downloads> irb
    irb(main):001:0>
    irb(main):002:0* require "tiny_tds"
    LoadError: cannot load such file -- tiny_tds/tiny_tds
            from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:126:in `require'
            from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:126:in `require'
            from C:/Ruby23/lib/ruby/gems/2.3.0/gems/tiny_tds-1.2.0-x86-mingw32/lib/tiny_tds.rb:22:in `rescue in <top (required)>'
            from C:/Ruby23/lib/ruby/gems/2.3.0/gems/tiny_tds-1.2.0-x86-mingw32/lib/tiny_tds.rb:25:in `<top (required)>'
            from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:135:in `require'
            from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
            from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:144:in `require'
            from (irb):2
            from C:/Ruby23/bin/irb.cmd:19:in `<main>'
    irb(main):003:0> require "tiny_tds"
    LoadError: cannot load such file -- tiny_tds
            from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:135:in `require'
            from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
            from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:144:in `require'
            from (irb):3
            from C:/Ruby23/bin/irb.cmd:19:in `<main>'
    irb(main):004:0> exit
    PS C:\Users\mesut.gunes\Downloads>
    PS C:\Users\mesut.gunes\Downloads> gem install --local .\tiny_tds-1.1.0-x86-mingw32.gem
    The system cannot find the path specified.
    Successfully installed tiny_tds-1.1.0-x86-mingw32
    Parsing documentation for tiny_tds-1.1.0-x86-mingw32
    Installing ri documentation for tiny_tds-1.1.0-x86-mingw32
    Done installing documentation for tiny_tds after 0 seconds
    1 gem installed
    PS C:\Users\mesut.gunes\Downloads> irb
    irb(main):001:0> require "tiny_tds"
    => true
    irb(main):002:0>
    irb(main):003:0* client = TinyTds::Client.new username: 'test', password: 'Paassword', host: 'test.local.db'
    => #<TinyTds::Client:0x23bfd88 @query_options={:as=>:hash, :symbolize_keys=>false, :cache_rows=>true, :timezone=>:local, :empty_sets=>true}>
    irb(main):004:0>
    irb(main):005:0* client.EXECUTE("SELECT TOP 1 ID from Order_Code_Order WHERE OrderOrderCode='634829'")
    
Mesut GUNES
  • 7,089
  • 2
  • 32
  • 49
0

This error is due to a problem in the 0.6.2 version of tiny_tds on windows, and not due to bundle being unable to resolve the correct version. You do not need to worry about having multiple versions of tiny_tds installed; the bundle exec command will read the Gemfile and load the correct versions of each gem, for whatever command is being executed.

While installing Redmine 3.3.3, I was able to get past this specific error by updating the Redmine Gemfile to use tiny_tds version 0.7.0 instead. As you suspected, you must edit the Gemfile in your Redmine folder. Search for "tiny_tds" and update the version number from 0.6.2 to 0.7.0.

After making this change, you must re-execute the bundle install --without development test rmagick command. This will install tiny_tds version 0.7.0. You should then be able to execute bundle exec rake generate_secret_token without errors.

I see that you already have both 0.6.2 and 1.0.4 installed. I am not familiar with tiny_tds at all, and I do not know if there are breaking changes between 0.6.2 and 1.0.4. I am under the impression that 0.7.0 is the first working version past 0.6.2, and therefore the version with the least risk of breaking changes. I can confirm that this is working in Redmine 3.3.3.stable using SQL Server without errors.

Chris Nielsen
  • 14,731
  • 7
  • 48
  • 54