6

I am trying to create rails engine using the below link: http://guides.rubyonrails.org/engines.html

I have received below errors

You have one or more invalid gemspecs that need to be fixed. The gemspec at /home/shariq/Documents/plugin/blorgh/blorgh.gemspec is not valid. Please fix this gemspec.

The validation error was '"FIXME" or "TODO" is not a description'

I already tried bundle update and bundle install

Here is all myworking

log
shariq@SDEV-MACHINE:~/Documents/plugin$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
shariq@SDEV-MACHINE:~/Documents/plugin$ rails -v
Rails 5.0.0.1
shariq@SDEV-MACHINE:~/Documents/plugin$ mysql --version
mysql  Ver 14.14 Distrib 5.7.15, for Linux (x86_64) using  EditLine wrapper
shariq@SDEV-MACHINE:~/Documents/plugin$ rails plugin new blorgh --mountable -d mysql
      create  
      create  README.md
      create  Rakefile
      create  blorgh.gemspec
      create  MIT-LICENSE
      create  .gitignore
      create  Gemfile
      create  app
      create  app/controllers/blorgh/application_controller.rb
      create  app/helpers/blorgh/application_helper.rb
      create  app/jobs/blorgh/application_job.rb
      create  app/mailers/blorgh/application_mailer.rb
      create  app/models/blorgh/application_record.rb
      create  app/views/layouts/blorgh/application.html.erb
      create  app/assets/images/blorgh
      create  app/assets/images/blorgh/.keep
      create  config/routes.rb
      create  lib/blorgh.rb
      create  lib/tasks/blorgh_tasks.rake
      create  lib/blorgh/version.rb
      create  lib/blorgh/engine.rb
      create  app/assets/config/blorgh_manifest.js
      create  app/assets/stylesheets/blorgh/application.css
      create  app/assets/javascripts/blorgh/application.js
      create  bin/rails
      create  test/test_helper.rb
      create  test/blorgh_test.rb
      append  Rakefile
      create  test/integration/navigation_test.rb
  vendor_app  test/dummy
         run  bundle install
You have one or more invalid gemspecs that need to be fixed.
The gemspec at /home/shariq/Documents/plugin/blorgh/blorgh.gemspec is not valid. Please fix this gemspec.
The validation error was '"FIXME" or "TODO" is not a description'
shariq@SDEV-MACHINE:~/Documents/plugin$ 

here is gemspec file:

##### log #######
$:.push File.expand_path("../lib", __FILE__)


require "blorgh/version"

Gem::Specification.new do |s|
  s.name        = "blorgh"
  s.version     = Blorgh::VERSION
  s.authors     = ["Shariq"]
  s.email       = ["gr8shariq@live.com"]
  s.homepage    = "TODO"
  s.summary     = "TODO: Summary of Blorgh."
  s.description = "TODO: Description of Blorgh."
  s.license     = "MIT"

  s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]

  s.add_dependency "rails", "~> 5.0.0", ">= 5.0.0.1"

end
shariqayaz
  • 63
  • 1
  • 8

4 Answers4

9

The error is self-explanatory. You have to replace the "TODO" strings in the gemspec with some "actual" descriptions.

ChrisF
  • 134,786
  • 31
  • 255
  • 325
nathanvda
  • 49,707
  • 13
  • 117
  • 139
  • my problem soved thanks. but on creating every engine it is require to modification? or is there anyway to solve it? – shariqayaz Oct 21 '16 at 18:51
2

There is an already closed issue #26474 in rails repository:
rails plugin new does not complete properly since bundler 1.12

Ruby on Rails team member vipulnsward said:

We don't bundle install now - fbd1e98

fbd1e98's commit message explains:

Do not run bundle install when generating a new plugin.

Since bundler 1.12.0, the gemspec is validated so the bundle install command will fail just after the gem is created causing confusion to the users. This change was a bug fix to correctly validate gemspecs.

Add an option -B to skip bundle install:

rails plugin new NAME -B

If you need to run the bundler, you can remove every occurrence of TODO and FIXME from your .gemspec file and then run bundle install.

AkaZecik
  • 980
  • 2
  • 11
  • 16
2

I met the issue today. Here is what I did(git diff) make me survive.

@@ -9,15 +9,15 @@ Gem::Specification.new do |spec|
   spec.version     = Blorgh::VERSION
   spec.authors     = ["Torvalds Du"]
   spec.email       = ["torvalds@ekohe.com"]
-  spec.homepage    = "TODO"
-  spec.summary     = "TODO: Summary of Blorgh."
-  spec.description = "TODO: Description of Blorgh."
+  spec.homepage    = ""
+  spec.summary     = "Summary of Blorgh."
+  spec.description = "Description of Blorgh."
   spec.license     = "MIT"

   # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
   # to allow pushing to a single host or delete this section to allow pushing to any host.
   if spec.respond_to?(:metadata)
-    spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
+    spec.metadata["allowed_push_host"] = "http://mygemserver.com"
   else
     raise "RubyGems 2.0 or newer is required to protect against " \
       "public gem pushes."

therefore, you have to remove all the text TODO from gem_name.gemspec.

Good luck.

TorvaldsDB
  • 766
  • 9
  • 8
1

Put this instead.


Gem::Specification.new do |spec|

  ...

  spec.homepage    = "https://example.com"
  spec.summary     = "Summary of App."
  spec.description = "Description of App."
  
  spec.metadata["allowed_push_host"] = spec.homepage
  spec.metadata["homepage_uri"] = spec.homepage
  spec.metadata["source_code_uri"] = spec.homepage
  spec.metadata["changelog_uri"] = spec.homepage

 ...
end
Jin Lim
  • 1,759
  • 20
  • 24