carrierwaveuploader / carrierwave-datamapper

Datamapper support for CarrierWave
36 stars 14 forks source link

Rails 3.0.9 won't start with carrierwave-datamapper installed? #6

Closed d11wtq closed 13 years ago

d11wtq commented 13 years ago

I'm just starting to integrate carrierwave into our project, but can't get our application to start up at all.

The gems added to our Gemfile are:

gem 'fog'
gem 'carrierwave' # I only added this one out of desperate hope
gem 'carrierwave-datamapper', :require => 'carrierwave/datamapper'

It just bails because it's trying to find "carrierwave/orm/datamapper", which doesn't exist.

chris@chris:~/flippa/rails$ unicorn -c config/unicorn.rb 
I, [2011-07-12T22:48:52.747296 #8101]  INFO -- : listening on addr=0.0.0.0:3000 fd=3
I, [2011-07-12T22:48:52.750488 #8101]  INFO -- : Refreshing Gem list
/home/chris/.rvm/gems/ruby-1.9.2-p180@flippa/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require': no such file to load -- carrierwave/orm/datamapper (LoadError)
    from /home/chris/.rvm/gems/ruby-1.9.2-p180@flippa/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `block in require'
    from /home/chris/.rvm/gems/ruby-1.9.2-p180@flippa/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from /home/chris/.rvm/gems/ruby-1.9.2-p180@flippa/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /home/chris/.rvm/gems/ruby-1.9.2-p180@flippa/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /home/chris/.rvm/gems/ruby-1.9.2-p180@flippa/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
    from /home/chris/.rvm/gems/ruby-1.9.2-p180@flippa/gems/carrierwave-0.5.5/lib/carrierwave.rb:111:in `<top (required)>'

Am I doing something wrong or is the documentation out of date?

d11wtq commented 13 years ago

Hmm, why does line 111 of carrierwave.rb (in the main project) require 'carrierwave/orm/datamapper', that doesn't seem to exist either here, or there?

solnic commented 13 years ago

@d11wtq yeah I fixed it in my fork and just sent a pull request to carrierwave: https://github.com/jnicklas/carrierwave/pull/396

I'm closing this issue as it's really a problem in carrierwave, not dm plugin. If somebody wants to use carrierwave-datamapper then this line in Gemfile should be sufficient:

gem 'carrierwave-datamapper', '~> 0.1.1', :require => 'carrierwave/datamapper'
d11wtq commented 13 years ago

Thanks! I'll give that a go.

PS: Didn't realise you were the maintainer :)

solnic commented 13 years ago

@d11wtq cause I am not, I'm a contributor with commit access :)

d11wtq commented 13 years ago

Now I'm hitting a different startup error, which this time seems to come from inside carrierwave-datamapper, though it's not immediately obvious why.

/home/chris/.rvm/gems/ruby-1.9.2-p180@flippa/gems/carrierwave-datamapper-0.1.1/lib/carrierwave/datamapper.rb:8:in `<module:DataMapper>': uninitialized constant CarrierWave::Mount (NameError)

It definitely exists in the CarrierWave source. My Gemfile.lock has:

chris@chris:~/flippa/rails$ grep carrierwave Gemfile.lock 
    carrierwave (0.5.5)
    carrierwave-datamapper (0.1.1)
      carrierwave
  carrierwave-datamapper (~> 0.1.1)
solnic commented 13 years ago

@d11wtq for now use edge stuff - it works, I got an app using both carrierwave and dm plugin from master.

@jnicklas @trevorturk guys can you take a look at my pull request: https://github.com/jnicklas/carrierwave/pull/397 - basically current carrierwave doesn't work at all with datamapper and sequel because of those broken require statements.

Would be nice to make a quick 0.5.5.1 release that fixes just that. I also want to clean up specs here in carrierwave-datamapper and we could push 0.2.0. Sounds good?

d11wtq commented 13 years ago

Edge is working fine (read... my app starts), thanks :)

trevorturk commented 13 years ago

@solnic, I merged that pull request and I can prep a 0.5.5.1 release today if you think we're ready.

solnic commented 13 years ago

@trevorturk Awesome! So I'm gonna prep 0.2.0 here today too :)

trevorturk commented 13 years ago

Released 0.5.6

solnic commented 13 years ago

@trevorturk OK I just bumped to 0.2.0 and specified version requirement on carrierwave. You can release it.

trevorturk commented 13 years ago

Released. You should ask @jnicklas for gemcutter permissions so you can do the releases, too. Thanks!

~/code/carrierwave-datamapper[master] > rake release
carrierwave-datamapper 0.2.0 built to pkg/carrierwave-datamapper-0.2.0.gem
Tagged v0.2.0
Pushed git commits and tags
Pushed carrierwave-datamapper 0.2.0 to rubygems.org
~/code/carrierwave-datamapper[master] > 
d11wtq commented 13 years ago

Awesome. I'm all good on non-edge versions now, thanks guys!

trevorturk commented 13 years ago

:thumbsup: