Startup problem: uninitialized constant PLATFORM (NameError)

294 views
Skip to first unread message

Brent

unread,
Mar 23, 2010, 2:35:23 PM3/23/10
to Lovd by Less
Hello,

This is probably less to do with LBL and more to do with my ruby/rails
installation, but perhaps someone here can help. I'm running on a Sun
x64 server (AMD cpus) with Solaris 10. I can run WebBrick fine with a
default rails deployment (`rails foo; ruby foo/script/server`), but
when I try it with LBL, I get this:

~/lovd/lovdbyless]$ ruby script/server
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:443:in `load_missing_constant': uninitialized constant
PLATFORM (NameError)
from /opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:80:in `const_missing_with_dependencies'
from /opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:92:in `const_missing'
from /home/admin/brentk/lovd/lovdbyless/vendor/gems/
colored-1.1/lib/colored.rb:1:in `<top (required)>'
from /opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:156:in `require'
from /opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:156:in `block in require'
from /opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:521:in `new_constants_in'
from /opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:156:in `require'
from /opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/
gem_dependency.rb:208:in `load'
from /opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/
initializer.rb:307:in `block in load_gems'
from /opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/
initializer.rb:307:in `each'
from /opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/
initializer.rb:307:in `load_gems'
from /opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/
initializer.rb:164:in `process'
from /opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/
initializer.rb:113:in `run'
from /home/admin/brentk/lovd/lovdbyless/config/environment.rb:
7:in `<top (required)>'
from /opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:156:in `require'
from /opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:156:in `block in require'
from /opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:521:in `new_constants_in'
from /opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:156:in `require'
from /opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/commands/
server.rb:84:in `<top (required)>'
from script/server:3:in `require'
from script/server:3:in `<main>'

Any suggestions?

Thanks!
Brent


Brent

unread,
Mar 23, 2010, 6:29:59 PM3/23/10
to Lovd by Less
Also:

:~/lovd/lovdbyless]$ rake --trace lovdbyless:getting_started

** Invoke lovdbyless:getting_started (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant PLATFORM


/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:443:in `load_missing_constant'

/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:80:in `const_missing_with_dependencies'

/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:92:in `const_missing'

/home/admin/brentk/lovd/lovdbyless/vendor/gems/colored-1.1/lib/
colored.rb:1:in `<top (required)>'

/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:156:in `require'

/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:156:in `block in require'

/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:521:in `new_constants_in'

/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:156:in `require'

/opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/gem_dependency.rb:
208:in `load'
/opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:307:in
`block in load_gems'
/opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:307:in
`each'
/opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:307:in
`load_gems'
/opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:164:in
`process'
/opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:113:in
`run'
/home/admin/brentk/lovd/lovdbyless/config/environment.rb:8:in `<top
(required)>'


/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:156:in `require'

/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:156:in `block in require'

/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:521:in `new_constants_in'

/opt/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:156:in `require'

/opt/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/tasks/misc.rake:4:in
`block in <top (required)>'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `block in
execute'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `block in
invoke_with_call_chain'
/opt/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:607:in `block in
invoke_prerequisites'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:604:in
`invoke_prerequisites'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:596:in `block in
invoke_with_call_chain'
/opt/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in
`invoke_task'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2
levels) in top_level'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block in
top_level'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in
`top_level'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in `block in
run'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/opt/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top
(required)>'
/opt/bin/rake:19:in `load'
/opt/bin/rake:19:in `<main>'


So I changed PLATFORM to RUBY_PLATFORM in these 3 files:

./vendor/gems/redgreen-1.2.2/bin/rg
./vendor/gems/colored-1.1/lib/colored.rb
./vendor/gems/will_paginate-2.2.2/test/console

Now I seem to have a different problem:

:~/lovd/lovdbyless]$ rake lovdbyless:getting_started
(in /home/admin/brentk/lovd/lovdbyless)
rake aborted!
/home/admin/brentk/lovd/lovdbyless/vendor/plugins/shoulda/lib/shoulda/
general.rb:50: syntax error, unexpected ':', expecting keyword_then or
',' or ';' or '\n'
when Regexp: assert(collection.detect { |e| e =~ x }, msg)
^
/home/admin/brentk/lovd/lovdbyless/vendor/plugins/shoulda/lib/shoulda/
general.rb:61: syntax error, unexpected ':', expecting keyword_then or
',' or ';' or '\n'
when Regexp: assert(!collection.detect { |e| e =~ x }, msg)
^
/home/admin/brentk/lovd/lovdbyless/vendor/plugins/shoulda/lib/shoulda/
general.rb:104: syntax error, unexpected keyword_end, expecting $end

Brent

unread,
Mar 23, 2010, 7:27:42 PM3/23/10
to Lovd by Less
OK, more progress! The problem seems to be that LBL is essentially
not ready for ruby 1.9.1.

Here's what I did so far:

Removed these plugins: shoulda, thinking-sphinx and installed them as
gems instead.

Changed config/environment.rb so that:
config.gem 'hpricot', :version=> '0.8.2'

The => was somehow being interpreted as =0.6.164, and the -v0.6.164
hpricot wouldn't build for me.

Modified these two lines at the top of the flickr gem file "/opt/lib/
ruby/gems/1.9.1/gems/rflickr-2006.02.01/lib/flickr/base.rb":

require 'digest/md5'
# no longer needed in 1.9.1 # require 'parsedate'

And now...

:~/lovd/lovdbyless]$ rake --trace lovdbyless:getting_started

(in /home/admin/brentk/lovd/lovdbyless)


** Invoke lovdbyless:getting_started (first_time)
** Invoke environment (first_time)
** Execute environment

** Invoke lovdbyless:check (first_time)
** Execute lovdbyless:check
TODO - check that all config ready
** Invoke gems:dependent:install (first_time)
** Execute gems:dependent:install
Updating class cache with 3136 classes...
Updating class cache with 3136 classes...
Updating class cache with 3136 classes...
** Invoke db:create:all (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create:all
Couldn't create database for {"adapter"=>"mysql",
"database"=>"lovdbyless_development", "username"=>"rails",
"password"=>"...", "encoding"=>"utf8"}, charset: utf8, collation:
utf8_unicode_ci (if you set the charset manually, make sure you have a
matching collation)
Couldn't create database for {"adapter"=>"mysql",
"database"=>"lovdbyless_test", "username"=>"rails", "password"=>"...",
"encoding"=>"utf8"}, charset: utf8, collation: utf8_unicode_ci (if you
set the charset manually, make sure you have a matching collation)
Couldn't create database for {"adapter"=>"mysql",
"database"=>"lovdbyless_production", "username"=>"rails",
"password"=>"...", "encoding"=>"utf8"}, charset: utf8, collation:
utf8_unicode_ci (if you set the charset manually, make sure you have a
matching collation)
** Invoke mig (first_time)
** Execute mig
rake db:migrate RAILS_ENV="development"
(in /home/admin/brentk/lovd/lovdbyless)
rake aborted!
no such file to load -- md5

(See full trace by running task with --trace)
rake db:test:clone
(in /home/admin/brentk/lovd/lovdbyless)
rake aborted!
no such file to load -- md5

(See full trace by running task with --trace)
(in /home/admin/brentk/lovd/lovdbyless)
rake aborted!
no such file to load -- md5

(See full trace by running task with --trace)
** Execute lovdbyless:getting_started
Finished setting up enviornment and application!
/home/admin/brentk/lovd/lovdbyless/vendor/gems/redgreen-1.2.2/lib/
redgreen.rb:17:in `initialize': wrong number of arguments (3 for 2)
(ArgumentError)
from /opt/lib/ruby/gems/1.9.1/gems/test-unit-2.0.7/lib/test/
unit/ui/testrunnerutilities.rb:24:in `new'
from /opt/lib/ruby/gems/1.9.1/gems/test-unit-2.0.7/lib/test/
unit/ui/testrunnerutilities.rb:24:in `run'
from /opt/lib/ruby/gems/1.9.1/gems/test-unit-2.0.7/lib/test/
unit/autorunner.rb:304:in `run'
from /opt/lib/ruby/gems/1.9.1/gems/test-unit-2.0.7/lib/test/
unit/autorunner.rb:52:in `run'
from /opt/lib/ruby/gems/1.9.1/gems/test-unit-2.0.7/lib/test/
unit.rb:321:in `block in <top (required)>'

Steven Bristol

unread,
Mar 24, 2010, 7:46:47 AM3/24/10
to lovdb...@googlegroups.com


It looks like the file/gem md5 is missing. You are correct, no one has
ported loved to 1.9 yet. Looks like you are doing good work, keep it
up!

cheers,
steven bristol

Brent

unread,
Mar 24, 2010, 12:59:18 PM3/24/10
to Lovd by Less
Actually I'm pretty sure that the new way to include md5 in ruby 1.9.1
is: require 'digest/md5'. There seems to be some chatter about this
on the intarwebs, e.g.:

http://forums.rightscale.com/showthread.php?t=169

I tried a hardlink from digest/md5.rb to md5.rb, but that doesn't
help. This is a major pain as a great many programs include md5 and
will thus have to be updated.

When I edit /opt/lib/
ruby/gems/1.9.1/gems/rflickr-2006.02.01/lib/flickr/base.rb and then
run LBL, I find that my changes magically vanish and it gets reset to
the original file. How does this happen, and where should I be making
these edits instead? I'm such a n00b ;). I'll eventually remove the
offending gems, create a locally modified version (submitting my
changes to the respective projects), and re-install them, but I'd like
to know how that happens.

Thanks,
Brent

On Mar 24, 5:46 am, Steven Bristol <stevenbris...@gmail.com> wrote:

Jonathon Brenner

unread,
Mar 24, 2010, 1:52:21 PM3/24/10
to lovdb...@googlegroups.com, Lovd by Less
There is a rails234_ruby191 branch, but I haven't done anything with
it in a while. Most tests pass.

> --
> You received this message because you are subscribed to the Google
> Groups "Lovd by Less" group.
> To post to this group, send email to lovdb...@googlegroups.com
> To unsubscribe from this group, send email to
> lovdbyless+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/lovdbyless?hl=en
> Who loves ya baby?
>
> To unsubscribe from this group, send email to lovdbyless
> +unsubscribegooglegroups.com or reply to this email with the words
> "REMOVE ME" as the subject.

Reply all
Reply to author
Forward
0 new messages