i added a gem "acts-as-taggable-on" and when i ran the rails g acts_as_taggable_on:migration command. i got this
Could not find generator 'acts_as_taggable_on:migration'. Maybe you meant 'active_record:migration', 'test_unit:integration' or 'migration'
Run rails generate --help for more options.
how to get this migration succesfull?
Related
I'm trying to run a specific feature test in my Rails app but keep getting this error
Cucumber './script/cucumber' script not found. To initialize Cucumber support, install the 'cucumber-rails' gem, reload generators and run the 'cucumber:install' generator from RubyMine (use Tools|Run Rails Generator... action)
I follow these commands
gem install cucumber-rails
rails g rspec:install
rails g cucumber:install
but then I get this message followed by the same error why I try to run the test
Could not find generator 'cucumber:install'.
Am I reloading the generators correctly?
I have a Rails (4.2) engine for a gem I'm writing.
Running: rails g migration Anything just gives the command help info
Usage:
rails new APP_PATH [options]
What am I missing from my gem/engine to run rails generators?
Update: I didn't create a namespaced engine. It works fine in my other engines so I must have done something different in this..
I'm wasting my time here and I can't seem to figure this out..
I have used Cucumber in Rails applications before, and if I'm not mistaken, it generates the features/step_definitions/web_steps.rb file when you run rails g cucumber:install. Right?
I looked this up in a book I was using a while ago to learn Rails and it says so there aswell:
It nevertheless passes because of the features/step_definitions/web_steps.rb
file, which was generated when you ran the rails generate cucumber:install command.
However, when I run it in this application I'm trying to start working on, it does not generate it..
$ rails g cucumber:install
create config/cucumber.yml
create script/cucumber
chmod script/cucumber
create features/step_definitions
create features/support
create features/support/env.rb
exist lib/tasks
create lib/tasks/cucumber.rake
force config/database.yml
No web_steps.rb to be found. Am I losing my mind here?
Thanks.
Which version of cucumber are you using? if it is a recent version, see
https://github.com/cucumber/cucumber-rails/blob/f027440965b96b780e84e50dd47203a2838e8d7d/History.md
I'm trying to install and set up this gem - https://github.com/galetahub/ckeditor, but when I follow the instructions and run:
rails generate ckeditor:install
I get an error because "rails generate" is a rails 3 command (I think?!).. so my question is, what is the equivalent rails 2 command to run this?
ruby script/generate ckeditor:install
This should do it in Rails 2
Sven
I am having trouble using script/generate. I am following the tree based navigation tutorial, which says to use script/plugin install git://github.com/rails/acts_as_tree.git or script/generate nifty_layout.
I keep getting:
No such file or directory -- script/plugin
I've tried these variations:
script/generate nifty_layout
rails generate nifty_layout
ruby script/generate nifty_layout
ruby generate nifty_layout
and they all tell me:
-bash: script/generate: No such file or directory
Am I missing something? Total ruby nuby here and I just can't seem to find an answer.
edit: rails 3 on Mac OS X 10.6
Rails 3 is your problem (or rather the cause of). Since rails 3 all of the "script/whatever" commands have been replaced with "rails whatever".
So now you want "rails generate ..." or "rails server" instead.
Be sure to watch version numbers or post dates when looking at tutorials :)
linkage:
Missing script/generate in Rails 3
There is a LOT of out-of-date information on the interwebs for Rails now as a result of it evolving quickly and being so popular. I use the Ruby on Rails Guides as my first stop for information as those pages seem to be the most current.
The rails generate info seems current.
you may try a couple things, first, make sure since you are using rails 3 that you have run 'bundle install'. depending on how you installed rails and which version of bundler you are using, it may not be finding your rails binary to execute the rails generate .. so you may try prefixing it with bundle exec rails g but that is deprecated and you should get a warning if you call it. Also, make sure you are following ryan's instructions for rails 3 (and run bundle install once you add to the gemfile) on his library: https://github.com/ryanb/nifty-generators
As a shortcut to rails server, you can use 'rails s'. Similarly for the console, 'rails c'.