Setting up a development environment using "Developer setup"


#1

Hi, I try to create a dev env using the Developer setup (http://manageiq.org/docs/guides/developer_setup.html).

I use a fresh fedora 25 environment. I hit error running the bin/setup

Fetching git://github.com/ManageIQ/rubywbem.git
Fetching gem metadata from https://rubygems.org/.......
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies..........................................................
Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    activesupport (~> 5.0.0)

    factory_girl (~> 4.5.0) was resolved to 4.5.0, which depends on
      activesupport (>= 3.0.0)

    google-api-client (~> 0.8.6) was resolved to 0.8.7, which depends on
      activesupport (< 5.0, >= 3.2)

    jbuilder (~> 2.5.0) was resolved to 2.5.0, which depends on
      activesupport (< 5.1, >= 3.0.0)

    paperclip (~> 4.3.0) was resolved to 4.3.7, which depends on
      activesupport (>= 3.2.0)

    rails (>= 5.0.0.1, ~> 5.0.0) was resolved to 5.0.1, which depends on
      activesupport (= 5.0.1)

    rails (>= 5.0.0.1, ~> 5.0.0) was resolved to 5.0.1, which depends on
      activesupport (= 5.0.1)

    rails (>= 5.0.0.1, ~> 5.0.0) was resolved to 5.0.1, which depends on
      activesupport (= 5.0.1)

    rails (>= 5.0.0.1, ~> 5.0.0) was resolved to 5.0.1, which depends on
      activesupport (= 5.0.1)

    rails (>= 5.0.0.1, ~> 5.0.0) was resolved to 5.0.1, which depends on
      activesupport (= 5.0.1)

    rails (>= 5.0.0.1, ~> 5.0.0) was resolved to 5.0.1, which depends on
      activesupport (= 5.0.1)

    rspec-rails (~> 3.5.0) was resolved to 3.5.2, which depends on
      activesupport (>= 3.0)
Bundler could not find compatible versions for gem "aws-sdk":
  In Gemfile:
    aws-sdk (~> 2.2.19)

    manageiq-providers-amazon was resolved to 0.1.0, which depends on
      aws-sdk (~> 2.6.14)

when I remove the aws-sdk gem, I can can continue a bit further, but hit the next error:

...
Installing gyoku 1.0.0
Installing nokogiri 1.6.8.1 with native extensions
Installing rack-test 0.6.3
Installing sprockets 3.7.1
Installing httpi 2.0.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/emulder/.gem/ruby/gems/nio4r-1.2.1/ext/nio4r
/usr/bin/ruby -r ./siteconf20170110-3146-1072wy0.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /home/emulder/.gem/ruby/gems/nio4r-1.2.1 for inspection.
Results logged to /home/emulder/.gem/ruby/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/gem_make.out

An error occurred while installing nio4r (1.2.1), and Bundler cannot continue.
Make sure that `gem install nio4r -v '1.2.1'` succeeds before bundling.

== Command ["bundle install"] failed ==

ruby --version
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]

Any clues?

UPDATE. The nio4r was fixed by installing more dev tools:
sudo dnf install ruby-devel sudo dnf group install “C Development Tools and Libraries”


#2

@evertmulder when I run bin/update or bin/setup, google-api-client resolves to 0.8.6, not 0.8.7. What git sha are you on? Are you on a branch such as euwe? I’m not sure why it’s trying to install an incompatible version. Do you have a gem locally that’s explicitly needing 0.8.7?

0.8.6 requires activesupport >= 3.2 while 0.8.7 adds the activesupport < 5.0 constraint that you’re having problems with since we’re now at 5.0.0.1. Note, we might want to upgrade to 0.9.x at some point.
cc @selmanj (if you have any ideas)

The second error is because you might be using ruby from a package and are missing the ruby-devel package.

Joe


#3

Hi,
thanks. I was behind in my fork of the ManageIQ repo. I will try again.

The second issue is fixed now.


#4

This is also relevant now and it’s not (yet) linked from the Developer setup article:

https://github.com/ManageIQ/guides/blob/master/developer_setup/classic_ui_split.md


#5

Thanks for the help @jrafanie and @martinpovolny. I have done the classic_ui_split as well.

A error I am hitting now is in the bin/update

** Preparing database
Dropped database 'vmdb_test'
Created database 'vmdb_test'
rails aborted!
GoodMigrations::LoadError: Rails attempted to auto-load:

/home/emulder/dev/manageiq/app/models/application_record.rb

Which is in your project's `app/` directory. The good_migrations
gem was designed to prevent this, because migrations are intended
to be immutable and safe-to-run for the life of your project, but
code in `app/` is liable to change at any time.

<snip>

/home/emulder/.gem/ruby/gems/good_migrations-0.0.2/tasks/good_migrations.rake:11:in `load_file'
/home/emulder/.gem/ruby/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:375:in `block in require_or_load'
/home/emulder/.gem/ruby/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:37:in `block in load_interlock'
/home/emulder/.gem/ruby/gems/activesupport-5.0.1/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
/home/emulder/.gem/ruby/gems/activesupport-5.0.1/lib/active_support/concurrency/share_lock.rb:150:in `exclusive'
/home/emulder/.gem/ruby/gems/activesupport-5.0.1/lib/active_support/dependencies/interlock.rb:11:in `loading'
/home/emulder/.gem/ruby/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:37:in `load_interlock'
<snip>

/home/emulder/.gem/ruby/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:51:in `run_command!'
/home/emulder/.gem/ruby/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>'
/home/emulder/dev/manageiq/bin/rails:4:in `require'
/home/emulder/dev/manageiq/bin/rails:4:in `<main>'
Tasks: TOP => evm:db:reset => db:migrate
(See full trace by running task with --trace)

== Command ["/home/emulder/dev/manageiq/bin/rails test:vmdb:setup"] failed ==

UPDATE:
Setting GOOD_MIGRATIONS=skip lets me run bin/setup and bin/update without errors (as suggested in https://github.com/ManageIQ/manageiq/issues/9602)


#6

A fix is in the works here. GOOD_MIGRATIONS=skip is a good workaround for now.