Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.0.RC1 Creating Extension Problem #932

Closed
rickygu opened this issue Dec 31, 2011 · 19 comments
Closed

1.0.0.RC1 Creating Extension Problem #932

rickygu opened this issue Dec 31, 2011 · 19 comments
Milestone

Comments

@rickygu
Copy link

rickygu commented Dec 31, 2011

I am trying to create an extension under version 1.0.0 RC1 by
following the tutorial:
http://edgeguides.spreecommerce.com/creating_extensions.html

I navigated to an directory not under any existing rails application
to create a standalone extension.

I run:

spree extension merchant 

(some how merchant.gemspec got put into the directory outside the
extension directory, I had to move that into merchant/)

cd merchant/ 
bundle exec rake test_app 

and I get an error:
rake aborted!
cannot load such file -- generators/spree/install/install_generator

So I look into generator folder and the folder is named merchant instead of spree. if I rename merchant folder to spree that error gets fixed but I get a different error: uninitialized constant Merchant::Generators::Rails

@CameronCarroll
Copy link

The gemspec error has already been fixed for next release I believe.

Did you try doing a bundle install before running rake task? Can't run a rake task that hasn't been installed yet. :)

@rickygu
Copy link
Author

rickygu commented Dec 31, 2011

no I did not run bundle install, previously.

I just tried running bundle install before rake task and I got this error:

Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
merchant (>= 0) ruby depends on
activesupport (~> 3.1.0) ruby

merchant (>= 0) ruby depends on
activesupport (3.2.0.rc1)

I googled the error and it feels like two different versions of activesupport is listed as the requirement.

@CameronCarroll
Copy link

I opened the same issue earlier today at #928

Seems like something upstream decided to force rails 3.2, but I don't know how to investigate this properly. Kind of poked around the immediate dependencies, rails spree teststuff, but didn't find anyone requiring 3.2.

@rickygu
Copy link
Author

rickygu commented Dec 31, 2011

I tried looking around for dependencies that need 3.2.0.rc1 but couldn't find anything.

@CameronCarroll
Copy link

When Schof went in to investigate today, it seems the dependency had already been fixed.
Just confirmed that my own extensions that were broken yesterday are fine today. So you should be good to go :)

@rickygu
Copy link
Author

rickygu commented Dec 31, 2011

I'm still having the problem, I've been playing around for the last 2 hours but no luck. Maybe I'm not installing the latest spree correctly.

I cloned spree repository, using master branch (seem to be the latest, I tried git checkout v1.0.0.rc1 but no dice, it had more bugs like having gemspec in the wrong directory)

git clone git://github.com/spree/spree.git
cd spree
bundle install
bundle exec rake clean
bundle exec rake gem:install 

then I start a new standalone extension

spree extension SpreeExtension
bundle install

then I get the same error:
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
spree_extension (>= 0) ruby depends on
activesupport (~> 3.1.0) ruby

spree_extension (>= 0) ruby depends on
activesupport (3.2.0.rc1)

@CameronCarroll
Copy link

Balls; I guess I only tested it against an integrated extension... I'm also
still having the issue with a standalone.

Maybe it's best to just create extensions in an integrated environment for
now, because once I bundled up the host spree app, i could bundle up the
extension as well.
I'm kind of just hoping that it'll blow over with the next release, since
they couldn't reproduce the issue...

Sorry for the false positive; Cheers,

Cameron

On Sat, Dec 31, 2011 at 2:55 PM, Ricky Gu <
reply@reply.github.com

wrote:

I'm still having the problem, I've been playing around for the last 2
hours but no luck. Maybe I'm not installing the latest spree correctly.

I cloned spree repository, using master branch (seem to be the latest, I
tried git checkout v1.0.0.rc1 but no dice, it had more bugs like having
gemspec in the wrong directory)

bundle install
bundle exec rake clean
bundle exec rake gem:install

then I start a new standalone extension

spree extension SpreeExtension
bundle install

then I get the same error:
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
spree_extension (>= 0) ruby depends on
activesupport (~> 3.1.0) ruby

spree_extension (>= 0) ruby depends on
activesupport (3.2.0.rc1)


Reply to this email directly or view it on GitHub:
#932 (comment)

@rickygu
Copy link
Author

rickygu commented Jan 1, 2012

so I ran spree extension merchant inside a existing spree app.

then added:

gem 'merchant', :path => '/Users/MacPro/Rails/edgestore/merchant'

bundle install # inside edgestore

merchant will get bundled into edgestore ok.

Then I go into merchant to create a resource, but it doesn't work because I didn't create a test_app. but I can't create a test_app without bundle install, and bundle install still gives me the dependency error.

@radar
Copy link
Contributor

radar commented Jan 1, 2012

You need to run bundle install from within the extension's directory, as you need to install the dependencies for the extension.

Please re-open if this is still a reproducable issue.

@radar radar closed this as completed Jan 1, 2012
@rickygu
Copy link
Author

rickygu commented Jan 1, 2012

When I run bundle install inside extension directory I get this error:

Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
merchant (>= 0) ruby depends on
activesupport (~> 3.1.0) ruby

merchant (>= 0) ruby depends on
activesupport (3.2.0.rc1)

please reopen the issue as I still cannot create a blank extension. I've been trying for the last two days. sanarothe is also having the same problem.

@rickygu
Copy link
Author

rickygu commented Jan 1, 2012

I created an screen cast of the issue I've been having. Please take a look and see if anyone else can reproduce. Thanks!

http://screenr.com/rgos

@radar radar reopened this Jan 2, 2012
@CameronCarroll
Copy link

Just wanted to confirm that I'm also still having this issue; Last night I
managed to get an integrated extension to bundle up, but trying again today
both integrated and standalone extensions have this conflict.

Rails 3.1.3, Spree 1.0.0.rc1, Ruby 1.9.2 (and 1.9.3, tried both.) Ricky's
screencast sums up the reproduction.

@radar
Copy link
Contributor

radar commented Jan 2, 2012

Ok, I was able to duplicate this issue but only with the :git line in my Gemfile. I tried it with :path and it didn't work.

Will be investigating now.

@radar
Copy link
Contributor

radar commented Jan 3, 2012

This seems to be due to the dependency we have specified here: https://github.com/spree/spree/blob/master/core/spree_core.gemspec#L32. Pay attention to the order.

When you install this gem, it installs the gem dependency like this (found in :

s.add_runtime_dependency(%q<rails>, ["<= 3.1.3", ">= 3.1.1"])

For whatever reason, RubyGems thinks that we want the absolutely greatest version of Rails possible which at the moment is Rails 3.2.0.rc1. It's completely ignoring the fact that we expressly want a version <= 3.1.3. If I manually patch the spree_core gemspec then that fixes this issue and I'm able to bundle install.

We should look deeper into a better fix for this.

@rickygu
Copy link
Author

rickygu commented Jan 3, 2012

Ryan,

Thanks for figuring out this problem. Just wondering, how do you track down this kind of problems? I'd love to learn more about troubleshooting spree so I can contribute and write patches in the future.

@radar
Copy link
Contributor

radar commented Jan 3, 2012

Well, to track this one down I looked at the Gemfile in the extension, which pointed at just the gemspec inside the extension. Then I looked in there, saw the dependency on spree_core which was the only thing in that depended on Rails.

I removed this dependency, ran bundle install and it worked. Just to make sure, I put the dependency back again and it broke. So that made me think the problem was in spree_core.

I went then to double check the Rails version specification in the spree_core gem was correct... and it was, according to me at least.

So then that made me consider how the gem was being installed. So I found the path where spree_core was installed using bundle show spree_core and then went back a directory from that and into the specifications directory (this is RVM, btw). Inside there, there's the spree_core-1.0.0.rc1.gemspec file. It's this file that Bundler uses to determine what versions of what gems to load. I went looking for the Rails gem version there and saw that it was the other way around.

Then I experimented by removing one of the dependencies, forcing it to be reliant in <= 3.1.3 and it worked.

@radar
Copy link
Contributor

radar commented Jan 9, 2012

I think I've fixed this now in @c1016bd17d5c53efb92cb089c72415f995526327. You may have to re-install the spree_core gem (use rake install inside the core directory of a fresh clone of the Spree) for it to work. Let me know please.

@schof
Copy link
Contributor

schof commented Jan 9, 2012

Most likely fixed by this commit

@schof schof closed this as completed Jan 9, 2012
@simonmorley
Copy link
Contributor

Sorry to comment on a close topic but we're also having the same issue. Using 1.0.0rc4 cloned from git. Was using 3.2.1 but backtracked to 3.1.3 after seeing this issue. The problem remains.

 Could not find gem 'spree_core (~> 1.0.0) ruby', which is required by gem 'spree_FlagPromotions (>= 0) ruby', in any of the sources

Any suggestions?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants