Being stupid with Enterprise Ruby and Typo from github

Hi everybody,

after some time not having done anything Ruby/Rails related I am trying
to
get into Typo again. I checked out Typo from github, edited the
database.yml
configuration as well as mail.yml. My local machine runs the latest
Enterprise Ruby.

Now, I want to get started running Typo locally in the development
environment. The databases exist, as does the user with correct
permissions.

I tried to migrate the database first and ran into the first problem:

rake --trace db:migrate

renders

rake aborted!
no such file to load – spec/rake/spectask
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in
require' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:innew_constants_in’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in
require' /home/tweisser/workspace/typo/typo/lib/tasks/rspec.rake:9 /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:inload_without_new_constant_marking’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in
load' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:innew_constants_in’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in
load' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/rails.rb:8 /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/rails.rb:8:ineach’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/rails.rb:8
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
/home/tweisser/workspace/typo/typo/Rakefile:10
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2349:in
load' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2349:inraw_load_rakefile’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1985:in
load_rakefile' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:instandard_exception_handling’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1984:in
load_rakefile' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1969:inrun’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
standard_exception_handling' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:inrun’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/opt/ruby-enterprise/bin/rake:19:in `load’
/opt/ruby-enterprise/bin/rake:19

I guess there is something wrong with the way I set up Enterprise Ruby.
Care
to show me what I can’t see right now?

Thanks,

Tobias

Tobias Weisserth wrote:

/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in
gem_original_require' standard_exception_handling’
/opt/ruby-enterprise/bin/rake:19

I guess there is something wrong with the way I set up Enterprise
Ruby. Care to show me what I can’t see right now?

This requirement is rspec or rspec-rails. Have you this gem on your
production environment ?

If you don’t want this error you can delete file :
/home/tweisser/workspace/typo/typo/lib/tasks/rspec.rake
It’s useless in production mode. We don’t send in our package.


Cyril M.

Hi there,

it was a weird issue with my setup on my box. I was using Ruby
Enterprise
Edition and its gems. When invoking “sudo gem …” however, a different
gem
binary got invoked although the Enterprise gem binary should have been
invoked instead according to what’s in my PATH. It has to do how sudo
treats
environment variables.

I figured it out. However, I still can’t get a “rake db:migrate” to
work,
due to the “can’t activate actionpack (= 1.13.6, runtime), already
activated
actionpack-2.2.2” issue which already has a Lighthouse ticket. Any idea?

Just to be sure, I add the list of gems I have installed and which are
used:

actionmailer (2.2.2)
actionpack (2.2.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.2.2, 1.15.6)
activeresource (2.2.2)
activesupport (2.2.2, 1.4.4)
cgi_multipart_eof_fix (2.5.0)
columnize (0.3.0)
daemons (1.0.10)
fastthread (1.0.1)
flexmock (0.8.4)
gem_plugin (0.2.3)
htmlentities (4.0.0)
json (1.1.3)
linecache (0.43)
mongrel (1.1.5)
mongrel_cluster (1.0.5)
mysql (2.7)
passenger (2.0.6)
postgres (0.7.9.2008.01.28)
rack (0.9.1)
rails (2.2.2)
rails-app-installer (0.2.0)
rake (0.8.3)
rspec (1.1.12)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.4)
sqlite3-ruby (1.2.4)
typo (5.2)
will_paginate (2.2.2)

So you can see, both versions of actionpack are installed.

I’d really like to spend some free time after work (where I do Java EE
all
day) on Typo and Rails. There are some small itches I’d like to scratch
myself in Typo and of it’s any good, you’re happy to have them.

Thanks,

Tobias

Hi Cyril,

thanks for your help. Indeed, I didn’t have the
datanoise-actionwebservice-2.2.2 gem installed. I got the gem from
github’s
gem repository.

I now have following gems installed:

*** LOCAL GEMS ***

actionmailer (2.2.2)
actionpack (2.2.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.2.2, 1.15.6)
activeresource (2.2.2)
activesupport (2.2.2, 1.4.4)
cgi_multipart_eof_fix (2.5.0)
columnize (0.3.0)
daemons (1.0.10)
datanoise-actionwebservice (2.2.2)
fastthread (1.0.1)
flexmock (0.8.4)
gem_plugin (0.2.3)
htmlentities (4.0.0)
json (1.1.3)
linecache (0.43)
mongrel (1.1.5)
mongrel_cluster (1.0.5)
mysql (2.7)
passenger (2.0.6)
postgres (0.7.9.2008.01.28)
rack (0.9.1)
rails (2.2.2)
rails-app-installer (0.2.0)
rake (0.8.3)
rspec (1.1.12)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.4)
sqlite3-ruby (1.2.4)
typo (5.2)
will_paginate (2.2.2)

“rake --trace gems” renders:

(in /home/tweisser/workspace/typo/typo)
rake aborted!
no such file to load –
/home/tweisser/workspace/typo/typo/config/…/vendor/rails/railties/lib/initializer
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
/home/tweisser/workspace/typo/typo/config/boot.rb:45:in
load_initializer' /home/tweisser/workspace/typo/typo/config/boot.rb:38:inrun’
/home/tweisser/workspace/typo/typo/config/boot.rb:11:in boot!' /home/tweisser/workspace/typo/typo/config/boot.rb:109 /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' /home/tweisser/workspace/typo/typo/Rakefile:4 /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2349:inload’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2349:in
raw_load_rakefile' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1985:inload_rakefile’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
standard_exception_handling' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1984:inload_rakefile’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1969:in
run' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:instandard_exception_handling’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in
run' /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31 /opt/ruby-enterprise/bin/rake:19:inload’
/opt/ruby-enterprise/bin/rake:19

The same goes for rake db:migrate.

I pulled the latest changes from vanilla typo on github.

I didn’t freeze Rails, so vendor/rails is empty.

Do I need to freeze Rails to work on the Typo sources?

thanks,

Tobias W.

Tobias Weisserth wrote:

actionmailer (2.2.2)
flexmock (0.8.4)
rails (2.2.2)
“rake --trace gems” renders:
/home/tweisser/workspace/typo/typo/config/boot.rb:38:in run' raw_load_rakefile’
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in

Do I need to freeze Rails to work on the Typo sources?

We don’t need freeze rails gems. I don’t understand why you have this
error. If you made git status, there are no change ?


Cyril M.

Hi Cyril,

I just pulled from fdv/typo and a git status renders:

On branch master

nothing to commit (working directory clean)

So far, all I did is adding my own sub modules to vendor/plugins and
themes.
This shouldn’t conflict with any later changes.

My guess is there is still something wrong with gems. I’ll try on
another
box later tonight.

thanks,

Tobias

Tobias Weisserth wrote:

already activated actionpack-2.2.2" issue which already has a
activesupport (2.2.2, 1.4.4)
mongrel_cluster (1.0.5)
ruby-debug-ide (0.4.4)
sqlite3-ruby (1.2.4)
typo (5.2)
will_paginate (2.2.2)

So you can see, both versions of actionpack are installed.

I’d really like to spend some free time after work (where I do Java EE
all day) on Typo and Rails. There are some small itches I’d like to
scratch myself in Typo and of it’s any good, you’re happy to have them.
In your list of gem you didn’t have datanoise-actionwebservice-2.2.2
gem. So Typo want load actionwebservice but when you have a old
actionwebservice it load this.

So you can check :

  1. Have you a freezing version of actionwebservice in
    /vendor/actionwebservice/ ?
  2. Can you launch command rake gems and paste his output ?


Cyril M.

You are 100% right.

vendor/rails exists and is emtpy. Deleting it magically “unlocks”
everything.

After deleting the empty vendor/rails directory I did a “git status”
which
returned no modified files. Is this git standard behaviour to not track
directories? In this case, that was the cause of a lot of trouble. I
checked
out typo from github with the vendor/rails directory existing. It would
be
best I guess to delete it upstream.

As soon as I’m back home I am also going to update the Typo Wiki on
github
as to what gems you need to have so typo will work after checkout.

cheers,

Tobias

Tobias Weisserth wrote:

    (in /home/tweisser/workspace/typo/typo)
    rake aborted!
    no such file to load --
    /home/tweisser/workspace/typo/typo/config/../vendor/rails/railties/lib/initializer

This sounds like the ./vendor/rails directory exists: If it exists,
rails will try to load itself from there even if you tell it to use the
gem in the configuration file.

Can you check if this directory exists? It should be empty. If it is,
can you remove it and try again?

Regards,
Matijs

Tobias Weisserth wrote:

An empty directory is allways non-track by git. You have maybe this
directory with an old manipulation, an old pull or other thing. I don’t
know. If you get a git clone. You don’t have this directory.


Cyril M.

Snip.

After deleting the empty vendor/rails directory I did a “git status”
which returned no modified files. Is this git standard behaviour to
not track directories?

It is git standard behavior to not track empty directories… Thats
why people litter .gitignore files everywhere if the directory is to
be retained.

In this case, that was the cause of a lot of trouble. I checked out
typo from github with the vendor/rails directory existing. It would
be best I guess to delete it upstream.

If it causes problems, I guess it indeed would be best.

As soon as I’m back home I am also going to update the Typo Wiki on
github as to what gems you need to have so typo will work after
checkout.

Also, it will be a neat idea to require gems right in the config/
environment.rb. Recent rails have a config.gem statement that allows
you to do just this – define gem dependencies.

Cheers,

Amol Hatwar
http://hatwar.org/epilogue/

Amol Hatwar wrote:

In this case, that was the cause of a lot of trouble. I checked out
typo from github with the vendor/rails directory existing. It would be
best I guess to delete it upstream.

If it causes problems, I guess it indeed would be best.

Sadly, that has no effect on existing vendor/rails directories: Git just
doesn’t track directories as separate units.

As soon as I’m back home I am also going to update the Typo Wiki on
github as to what gems you need to have so typo will work after checkout.

Also, it will be a neat idea to require gems right in the
config/environment.rb. Recent rails have a config.gem statement that
allows you to do just this – define gem dependencies.

config.gem is very useful, and is used for other dependencies for type,
but it doesn’t work properly for rspec-rails: Specifying that gem in
config/environment.rb makes rails always use the test database :-(.

Regards,
Matijs

Weird. But anyhow. It works! :slight_smile: