11.16.07

Merb on Windows: PEBKAC! (dependency and user error)

Posted in Programming, Ruby, merb at 11:56 pm by Robert Horvick

After my last merb post Ezra left a comment with some concrete suggestions to move forward with getting merb working on Windows.  My next post will cover that exact topic but I wanted to create a post to captute the stack traces of the errors I hit when trying to get merb running.

The first was a dependency issue.  Merb requires json but I did not have it installed.  I think the merb gem should have noted this dependency but honestly I don’t understand gems enough to know for sure.  The output of the merb command and call stack is:

C:\InstantRails\ruby\merb>merb
Merb started with these options:

:query_string_whitelist: []

:reloader: true
:environment: development
:merb_root: C:/InstantRails/ruby/merb
:exception_details: true
:cache_templates: false
:reloader_time: 0.5
:host: 0.0.0.0
:use_mutex: true
:port: “4000″
:session_id_cookie_only: true

Using pure ruby JSON lib
Using pure ruby JSON lib
C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’: no such file to load — json/pure (LoadError)
        from C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
        from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/merb-0.4.1/lib/merb.rb:28
        from C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require’
        from C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require’
        from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/merb-0.4.1/lib/merb/server.rb:236:in `initialize_merb’
        from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/merb-0.4.1/lib/merb/server.rb:573:in `mongrel_start’
        from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/merb-0.4.1/lib/merb/server.rb:509:in `run’
        from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/merb-0.4.1/bin/merb:6
        from C:/InstantRails/ruby/bin/merb:16:in `load’
        from C:/InstantRails/ruby/bin/merb:16

I fixed this by installing json 1.1.1 (mswin32).

C:\InstantRails\ruby\merb>gem install json
Select which gem to install for your platform (i386-mswin32)
 1. json 1.1.1 (mswin32)
 2. json 1.1.1 (ruby)
 3. json 1.1.0 (mswin32)
 4. json 1.1.0 (ruby)
 5. Skip this gem
 6. Cancel installation
> 1
Successfully installed json-1.1.1-mswin32
Installing ri documentation for json-1.1.1-mswin32…

No definition for cState_configure

No definition for cState_configure
Installing RDoc documentation for json-1.1.1-mswin32…

No definition for cState_configure

No definition for cState_configure

With the dependencies resolved I re-ran merb but hit another error message.  I’ll give you the output and call stack first and see if you see the problem:

C:\InstantRails\ruby\merb>merb
Merb started with these options:

:query_string_whitelist: []

:reloader: true
:environment: development
:merb_root: C:/InstantRails/ruby/merb
:exception_details: true
:cache_templates: false
:reloader_time: 0.5
:host: 0.0.0.0
:use_mutex: true
:port: “4000″
:session_id_cookie_only: true

C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’: no such file to load — C:/InstantRails/ruby/merb/config/merb_init.rb (LoadError)
        from C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
        from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/merb-0.4.1/lib/merb/server.rb:250:in `initialize_merb’
        from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/merb-0.4.1/lib/merb/server.rb:573:in `mongrel_start’
        from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/merb-0.4.1/lib/merb/server.rb:509:in `run’
        from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/merb-0.4.1/bin/merb:6
        from C:/InstantRails/ruby/bin/merb:16:in `load’
        from C:/InstantRails/ruby/bin/merb:16

See it yet?

Require failed to find the file C:/InstantRails/ruby/merb/config/merb_init.rb.  But why?

Because I’m an idiot :).  I ran the merb command from the wrong directory.  I needed to move to the application directory at which point I re-ran merb and …

Wait for the next post!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Comment