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
Rack gem installation & Middleman commands have Ruby version conflict #2041
Comments
Hey @davedub it sounds like you need to have a different set of gems for each ruby version. To get the command to work, you'll just need to install middleman on Ruby 2.2.2 with |
Appreciate the tip, @aturkewi, but I am not sure I see this as being the problem I am running into. I set up a new project and make sure 2.2.2 is running locally.
Then I check which gems are installed:
So it looks like I have local gems inside 2.2.2 , but when I try to use a Middleman command, it still says it's not found:
|
Hmm, I'm wondering if this might have to do with how you have your environment setup more so than middleman. I'm using // ♥ rvm use 2.2.2
Using /Users/avidor/.rvm/gems/ruby-2.2.2
[18:25:09] middle_man
// ♥ middleman init new-project-2
-bash: middleman: command not found So I went through and installed middleman:
And then I had no problem creating a new project:
You could try re-intalling them middleman gem or perhaps look into using gemsets? I don't have a ton of experience with |
Hey thanks ... using rbenv gemsets seemed to do the trick. |
Actually, in case others get confused by looking at this issue and its apparent resolution, let me clarify. My mistake was that I did not have the Middleman gem installed for 2.2.2, not that I wasn't using rbenv-gemset. When I ran --
-- and I knew the local Ruby version was 2.2.2, the CLI returned a list of the gems with that name that I then presumed were installed for that local Ruby version. Otherwise, I thought it would return an empty set. But apparently not. I saw the gem as installed but it really wasn't. Once I went ahead and again tried to install the middleman gem while 2.2.2 was running locally - |
On a default install, I can't set-up a Middleman 4.2 project that runs Rack and also is able to use the 'middleman' commands. The problem is that Rack requires Ruby >= 2.2.2, but Middleman commands only exist for 2.1.0 and 2.2.0.
Steps to reproduce the problem (from a clean middleman installation)
Run bundle install where the option to include Rack has been selected, with local Ruby version set at 2.2.0, this message appears:
Gem::InstallError: rack requires Ruby version >= 2.2.2.
An error occurred while installing rack (2.0.1), and Bundler cannot continue.
Make sure that gem install rack -v '2.0.1' succeeds before bundling.
Switch .ruby-version over to 2.2.2:
~/projects/project_name $ rbenv local 2.2.2
Now all gems get installed.
Bundle complete! 7 Gemfile dependencies, 52 gems now installed.
But I can then no longer use "middleman" commands:
~/projects/project_name $ middleman build
Which replies -
rbenv: middleman: command not found
The middleman command exists in these Ruby versions:
2.1.0
2.2.0
Any chance you will update soon to make this work more smoothly?
Additional information
The text was updated successfully, but these errors were encountered: