Jake, you need to do gem 'dm-sqlite-adapter', '~> 1.0.0'
without any :require option On Sat, Jun 12, 2010 at 04:59, Ken Robertson <[email protected]> wrote: > I haven't used DM 1.0 bundler yet, but one suggestion: > > gem "dm-sqlite-adapter", "1.0.0", :require => 'sqlite_adapter' > > Might try taking out the ":require" parameter. DM itself requires the > adapter when it is needed. You aren't requiring the mysql adapter, > but you are on the sqlite adapter. > > Ken > > > On Fri, Jun 11, 2010 at 3:08 PM, Jake Mallory <[email protected]> wrote: >> I've got a non-rails app which has a scripts running from cron. I'm >> using bundler to load the gems. My environment.rb file sets up DM >> which is failing on #setup: (Gemfile and environment.rb file follow >> error stack) >> >> ruby-1.8.7-p249 > require 'config/environment' >> /Users/jmallory/Dev/aboutone/aboutone-crons/.bundle/gems/dm-core-1.0.0/ >> lib/dm-core.rb:49: warning: already initialized constant Inflector >> MissingSourceFile: no such file to load -- sqlite_adapter >> from /Users/jmallory/Dev/aboutone/aboutone-crons/.bundle/gems/ >> activesupport-2.3.8/lib/active_support/dependencies.rb:156:in >> `require' >> from /Users/jmallory/Dev/aboutone/aboutone-crons/.bundle/gems/ >> activesupport-2.3.8/lib/active_support/dependencies.rb:156:in >> `require' >> from /Users/jmallory/Dev/aboutone/aboutone-crons/.bundle/gems/ >> activesupport-2.3.8/lib/active_support/dependencies.rb:521:in >> `new_constants_in' >> from /Users/jmallory/Dev/aboutone/aboutone-crons/.bundle/gems/ >> activesupport-2.3.8/lib/active_support/dependencies.rb:156:in >> `require' >> from /Users/jmallory/Dev/aboutone/aboutone-crons/.bundle/gems/dm- >> core-1.0.0/lib/dm-core/adapters.rb:165:in `load_adapter' >> from /Users/jmallory/Dev/aboutone/aboutone-crons/.bundle/gems/dm- >> core-1.0.0/lib/dm-core/adapters.rb:133:in `adapter_class' >> from /Users/jmallory/Dev/aboutone/aboutone-crons/.bundle/gems/dm- >> core-1.0.0/lib/dm-core/adapters.rb:13:in `new' >> from /Users/jmallory/Dev/aboutone/aboutone-crons/.bundle/gems/dm- >> core-1.0.0/lib/dm-core.rb:257:in `setup' >> from ./config/environment.rb:16 >> from /Users/jmallory/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/ >> 1.8/rubygems/custom_require.rb:31:in `gem_original_require' >> from /Users/jmallory/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/ >> 1.8/rubygems/custom_require.rb:31:in `require' >> from (irb):1 >> from /Users/jmallory/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/date.rb: >> 374 >> >> ==[ Gemfile ]============ >> source :gemcutter >> gem "activesupport", "2.3.8", :require => 'active_support' >> gem "mail", "2.2.2" >> gem "ruby-gmail", :require => 'gmail', :git => "git://github.com/ >> tinomen/ruby-gmail.git" >> gem "extlib", "0.9.15" >> gem "data_mapper", "1.0.0" >> gem "dm-migrations", "1.0.0" >> gem "dm-mysql-adapter", "1.0.0" >> >> group :development do >> gem "ruby-debug", "0.10.3" >> gem "sqlite3-ruby", "1.3.0", :require => "sqlite3" >> gem "dm-sqlite-adapter", "1.0.0", :require => 'sqlite_adapter' >> end >> >> ===[ environment.rb ]======= >> require 'rubygems' >> require 'bundler' >> ENV["ABOUTONE_ENV"] ||= :development >> Bundler.setup(:default, ENV["ABOUTONE_ENV"]) >> Bundler.require(:default, ENV["ABOUTONE_ENV"]) >> LIB_PATH = File.expand_path(File.join(File.dirname(__FILE__), '../ >> lib')) >> $LOAD_PATH << LIB_PATH >> db_config = YAML::load(IO.read(File.dirname(__FILE__) + "/ >> database.yml")) >> DataMapper::Logger.new($stdout, :warn) >> DataMapper.setup(:default, "sqlite:// >> memory:")#db_config[ENV["ABOUTONE_ENV"]]) >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "DataMapper" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/datamapper?hl=en. >> >> > > -- > You received this message because you are subscribed to the Google Groups > "DataMapper" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/datamapper?hl=en. > > -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
