0

I am trying to rake db:migrate. I cloned a repository and tried to rake db:migrate, but get this error :

rake aborted!
Unable to determine name from existing gemspec. Use :name => 'gemname' in #inst
ll_tasks to manually set it. C:/Users/Dila/Documents/emo_project/Rakefile:6:in `<top (required)>'

In my Rakefile line 6, I have this :

require "bundler/gem_tasks"

This is what I got, when I trace it :

C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/gem_helper.rb:30:i
n `initialize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/gem_helper.rb:14:i
n `new'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/gem_helper.rb:14:i
n `install_tasks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/gem_tasks.rb:2:in
`<top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/depen
dencies.rb:251:in `require'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/depen
dencies.rb:251:in `block in require'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/depen
dencies.rb:236:in `load_dependency'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/depen
dencies.rb:251:in `require'
C:/Users/Dila/Documents/emo_project/Rakefile:6:in `<top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `l
oad'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `l
oad_rakefile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:589:in `
raw_load_rakefile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:89:in `b
lock in load_rakefile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `
standard_exception_handling'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:88:in `l
oad_rakefile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:72:in `b
lock in run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `
standard_exception_handling'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `r
un'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/bin/rake:33:in `<top (required)>
'
C:/Ruby193/bin/rake:23:in `load'
C:/Ruby193/bin/rake:23:in `<main>'

I have no idea what is went wrong, because yesterday I was working in my office and everything was ok. I just wanna try to clone the repository in my laptop, but it doesn't work.

my gemfile :

source 'https://rubygems.org'

if RUBY_VERSION =~ /1.9/
  Encoding.default_external = Encoding::UTF_8
  Encoding.default_internal = Encoding::UTF_8
end

group :production do
  gem 'pg', '0.12.2'
end

gem 'magic_encoding'

gem 'rails', '3.2.2'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'

gem 'activeadmin'

gem "bcrypt-ruby", :require => "bcrypt"

# to copy to clipboard
gem 'zeroclipboard-rails'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  #gem 'therubyracer'

  gem 'uglifier', '>= 1.0.4'
  gem 'sass-rails', '~> 3.2'
  gem 'bootstrap-sass', '~> 2.3.1.0'
  gem 'closure-compiler'

end

gem 'jquery-rails'
ishwr
  • 725
  • 3
  • 14
  • 36
  • did you run `bundle install` before `rake db:migrate`? – amalrik maia May 05 '13 at 15:40
  • yes, and everything was ok – ishwr May 05 '13 at 15:45
  • I realized there is no 'using sqlite', when I bundle install it. Eventhough I have " gem 'sqlite3' " in my gemfile. I never had something like this before. Have you or anyone else ever had something like this before? – ishwr May 05 '13 at 15:55
  • Could you post your Gemfile and the messages you got when run `bundle install`? – amalrik maia May 05 '13 at 16:15
  • I didn't get Error message when I run bundle install, but I can add my gemfile. Thanks for your response :) – ishwr May 05 '13 at 16:17
  • I also couldn't rake db:create. I got the same error message with before : rake aborted! Unable to determine name from existing gemspec. Use :name => 'gemname' in #inst ll_tasks to manually set it. C:/Users/Dila/Documents/emo_project/Rakefile:6:in `' – ishwr May 05 '13 at 16:37
  • This is a shot in the dark, but delete your `Gemfile.lock` file and run bundle install again. – thank_you May 05 '13 at 16:45
  • done it, still doesn't work. Still rake aborted and when I bundle install, I didn't see using sqlite – ishwr May 05 '13 at 16:52
  • Is there a reason why you declared pg to only run in production yet also have sqlite run on test, development, AND on the production platform? Which database is your database.yml file connecting to? – thank_you May 05 '13 at 17:00
  • I actually only use sqlite. Most of the gem in my gemfile I already had it when I created the app. – ishwr May 05 '13 at 17:03

1 Answers1

0

I see in your gemfile that you set postgresql as your production database, however you also set sqlite to run on production, test, and development.

group :production do
  gem 'pg', '0.12.2'
end

# Skip some lines to here

gem 'sqlite3'

I would make sure your database is uniform across the test, development, and production servers. I would remove sqlite3 and simply have

group :production do
  gem 'pg', '0.12.2'
end

replaced with

gem 'pg', '0.12.2'

That way, postgresql will run on all platforms. Or if your database.yml is connected to sqlite, then get rid of postgresql and keep the sqlite gem in your gemfile.

thank_you
  • 11,001
  • 19
  • 101
  • 185
  • it worked :) thanks for your answer ^^ now I see sqlite in my bundle, but I still cannot rake db:migrate – ishwr May 05 '13 at 17:13
  • nevermind. it worked now thank you :) apparently I still have gemspec file that I don't use anymore – ishwr May 05 '13 at 17:17