You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run e.g. umlaut my_new_app, during the generation process I see the lines:
apply /Users/ryan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/umlaut-4.1.7/lib/generators/umlaut_app_template.rb
append Gemfile
generate umlaut:remove_turbolinks
Could not find gem 'mysql2 (< 0.5, >= 0.3.13)' in any of the gem sources listed in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.
generate umlaut:install
Could not find gem 'mysql2 (< 0.5, >= 0.3.13)' in any of the gem sources listed in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.
run bundle install
At the end of this process, there's no ./config/umlaut_services.yml file in the app directory (presumably generate umlaut:install failed due to missing dependencies). If I run bundle exec rails generate umlaut:install again afterwards, the file gets generated because the Rails generator ran bundle install after https://github.com/team-umlaut/umlaut/blob/master/lib/generators/umlaut_app_template.rb.
There's probably a few different ways to go about fixing this:
Add mysql2 to the umlaut.gemspec dependencies, so that after a user runs gem install umlaut, they'll already have the mysql2 dependency when they run umlaut my_new_app (which passes -d mysql to the Rails generator).
Move the generate calls in umlaut_app_template.rb into an after_bundle block. This is mentioned there as available in future versions of Rails, and looks like it was added in 4.2.x, so this would be a clean solution but break backward compatibility with other versions of Rails.
The text was updated successfully, but these errors were encountered:
Hmm, thanks for catching this, annoying. #3 sounds reasonable to me, if it works -- I think it's probably okay to require Rails 4.2 at this point, especially for future releases. We could also put some conditional logic in that does #3 if Rails.version is at least 4.2, but does it the old somewhat broken way in earlier Rails?
When I run e.g.
umlaut my_new_app
, during the generation process I see the lines:At the end of this process, there's no
./config/umlaut_services.yml
file in the app directory (presumablygenerate umlaut:install
failed due to missing dependencies). If I runbundle exec rails generate umlaut:install
again afterwards, the file gets generated because the Rails generator ranbundle install
after https://github.com/team-umlaut/umlaut/blob/master/lib/generators/umlaut_app_template.rb.There's probably a few different ways to go about fixing this:
bundle install
to https://github.com/team-umlaut/umlaut/blob/master/lib/generators/umlaut_app_template.rb after appending to theGemfile
, but before callinggenerate
. This may be a little redundant because apparently the default Rails generator will runbundle install
afterwards anyway.mysql2
to theumlaut.gemspec
dependencies, so that after a user runsgem install umlaut
, they'll already have themysql2
dependency when they runumlaut my_new_app
(which passes-d mysql
to the Rails generator).generate
calls inumlaut_app_template.rb
into anafter_bundle
block. This is mentioned there as available in future versions of Rails, and looks like it was added in 4.2.x, so this would be a clean solution but break backward compatibility with other versions of Rails.The text was updated successfully, but these errors were encountered: