I am trying to use the MindBody Gem but when I attempt to run: $ gem install mindbody-api I see the error:
$ gem install mindbody-api
ERROR: Could not find a valid gem 'mindbody-api' (>= 0) in any repository
I've been able to get it working in my gemfile by including the path of the GitHub page: gem 'mindbody-api', :git => 'git://github.com/wingrunr21/mindbody-api.git' and I am successful when I run bundle install but I've noticed that my version is missing a function that is present in the GitHub Repo, specifically:
MindBody::Services::SaleService.checkout_shopping_cart(search_creds)
NoMethodError: undefined method `checkout_shopping_cart' for MindBody::Services::SaleService:Class
despite the function being listed on the GitHub repo SaleService page. Any idea what I should try next?
In your comment under the question it shows that you have older version of the gem:
rvm/gems/ruby-2.2.3#awaken/bundler/gems/mindbody-api-579af18314d2.
So if you browse the repo at this point of time (579af18314d2) you will see that the method does not exist yet - link
In order to fix it you need to update it to thelatest version, which you can do by:
bundle update --source mindbody-api
Also to verify that you have the latest version when you do bundle show mindbody-api it should show something like: .rvm/gems/ruby-2.2.3#awaken/bundler/gems/mindbody-api-f58110f2b255
Regarding the install:
The only version released is an alpha release, that's why you can't install it. You can, however, install the alpha version with:
gem install mindbody-api -v 1.0.1.alpha
Regarding the method missing:
It appears there is a bug in the way the operations are loaded. I was able to get the method loaded under certain circumstances (cloning & building myself, I think) but even then the behavior wasn't consistent.
The gem hasn't had any significant major updates in a few years. It's not clear if the gem is maintained but I think your best bet might be to create a github repo issue, or fork & fix it yourself.
Related
So, I have no Ruby experience at all. However, I'm being asked to look after some Ruby on Rails / Ruby source code that was left behind by my predecessor. I'd like to at least get it to install and run within its Docker container.
From what I can tell, it is failing because of the mimemagic problem from a couple of years ago. It has a dependency on mimemagic v0.3.0 . I know the right thing to do would be to move on to the recent versions that have not been yanked. But, with my limited experience with Ruby, I'd like to at least get my predecessor's code to install and run.
Since moving up to the earliest mimemagic that is available (v0.3.7) appears to break other things, I have been trying to install v0.3.0 using the GitHub reference as a work around.
This:
gem 'mimemagic', github: 'mimemagicrb/mimemagic', ref: 'a4b038c6c1b9d76dac33d5711d28aaa9b4c42c66'
complains that I'm transmitting without encryption. It ultimately fails to fetch with a connection time out.
Meanwhile, this:
gem 'mimemagic', git: 'git#github.com:mimemagicrb/mimemagic.git', ref: 'a4b038c6c1b9d76dac33d5711d28aaa9b4c42c66'
complains that the host key verification has failed.
Finally, this gets me a little further:
gem 'mimemagic', git: 'https://github.com/mimemagicrb/mimemagic.git', ref: 'a4b038c6c1b9d76dac33d5711d28aaa9b4c42c66'
but an error later on looks like this:
rake aborted!
Bundler::GitError: The git source https://github.com/mimemagicrb/mimemagic.git is not yet checked out. Please run `bundle install` before trying to start your application
I have this feeling that "quickly getting it to work" isn't a reality and perhaps all of this will take a lot more than the 1-2 days I've spent so far. I just would like to check what the correct gem/git commands are, and if any of the above three are close.
Thank you!
As the error suggests, you must run the bundle install command before starting the application server or accessing the console.
The reference in the Gemfile is added correctly.
gem 'mimemagic', git: 'https://github.com/mimemagicrb/mimemagic.git', ref: 'a4b038c6c1b9d76dac33d5711d28aaa9b4c42c66'
If you've already executed the mentioned command, can you update the question to have the output for this command?
P.S. Read more about the bundle install command here.
CircleCI install dependencies error:
Your bundle is locked to my_cool_gem (0.7.2), but that version could not be
found in any of the sources listed in your Gemfile. If you haven't changed
sources, that means the author of my_cool_gem (0.7.2) has removed it. You'll
need to update your bundle to a version other than my_cool_gem (0.7.2) that
hasn't been removed in order to install.
Screenshot of CircleCI output:
CircleCI can't find a gem that I published to GitHub Packages, yet I have no such problem in local development.
I have qualifying versions of RubyGems and Bundler, as per GitHub's docs - https://docs.github.com/en/free-pro-team#latest/packages/guides/configuring-rubygems-for-use-with-github-packages - and I believe I have followed the instructions to publish and use said published gems... and, again, usage works locally but fails in CircleCI...
RubyGems version:
-bash> gem --version
3.0.9
Bundler version:
-bash> bundle --version
Bundler version 1.17.3
Gemfile:
source 'https://rubygems.org'
source 'https://rubygems.pkg.github.com/my_cool_org'
gem 'my_cool_gem', '0.7.2'
Note that I have also tried:
source 'https://rubygems.org'
source 'https://rubygems.pkg.github.com/my_cool_org'
source 'https://rubygems.pkg.github.com/my_cool_org' do
gem 'my_cool_gem', '0.7.2'
end
Try running bundle update my_cool_gem if it modifies Gemfile.lock that should fix it.
Have you verified that it's actually still available at the source? I know you said it works locally, but that could be because of local cached versions of the gem. Bundle won't try to install something that's already there.
You might be able to verify this by uninstalling it locally and running bundle install again.
Ensure that you've correctly set the environment variable for authenticating with rubygems.pkg.github.com.
(Though the variable may be set, the value may be incorrect - as was the case for me.)
Interesting, sounds like a image bug. What happens if you try to list all available versions of your gem? gem search ^gem_name$ --all?
Have you tried to force update beforehand? sudo gem update --system
For me, the problem was that access tokens was different on local machine and on CI. And the key on CI was valid, but it had no permission for specific repository containing requested gem.
Despite Github provides single registry per organization, gems are associated with company's repositories. And packages within registry will be visible or invisible depending on permissions to these repositories that access tokens have. For example, user can have access to some repositories of organization and don't have to others — if using that user's personal access token, only gems associated with permitted repositories will be visible. Others will be hidden, so the error is "that version cannot be found".
I ran into this again, and this time I could not solve it with the solution I used last time, and no other solution worked either, so instead I chose to temporarily work around the issue by placing a copy of the gem in question directly into my app (a process known as "vendoring"; see this, this, and this):
gem unpack my_cool_gem # note, I actually had to specify the version with -v 0.12.1
mkdir vendor/gems/
mv my_cool_gem-0.12.1 vendor/gems/
In Gemfile, use the :path option rather than :source:
gem 'my_cool_gem', '0.12.1', path: 'vendor/gems'
Then generate Gemfile.lock:
bundle install
OK, so I am trying to install the Adhoq gem into my Rails 5 project.
When I add it like usual (gem 'adhoq') it fails as the default dependencies are for rails 4 with a few other outdated libraries of which I have more recent versions.
I can see gemfiles/Gemfile-rails-5.0x exists but I have never seen this design pattern before.
I know I could fork it and manually update the dependencies but that presents a whole host of other issues and since this gemfile exists it leads me to something I currently don't know about Bundler or gems as a whole.
A glance at the Bundler docs wasn't helpful, but I will keep digging.
What is it that I am missing?
Do this:
Add gem 'adhoq', '0.1.2' into Gemfile. (0.1.2 is latest)
before bundle install check the dependencies of other gems with adhoq. To check runtime dependencies please refer this website. https://rubygems.org/gems/adhoq.
Execute bundle install. You will not receive any errors if all runtime dependencies satisfied for the adhoq gem.
Still If you are not able to execute bundle install than Remove Gemfile.lock. and once again execute bundle install. Hope this will work.
Note: To avoid step 4 you can update particular gem one by one to satisfied runtime dependencies.
Cheers
I was using the best_in_place gem on a project but decided it was not needed and removed it from the gemfile and the other references to it on my code.
Now everytime I run a rails command I got this error
The git source https://github.com/aaronchi/best_in_place.git is not yet checked out. Please run bundle install before trying to start your application
I dont even have this gem installed anymore, I created another gemset on rvm, reinstalled rails, reinstalled ruby, followed the steps on https://github.com/bundler/bundler/blob/master/ISSUES.md
No success yet...
The following page may have what you're looking for. If so, we might need to mark this as a duplicate:
is not checked out... bundle install does NOT fix help!
Let me know if that's not the case.
I am super, super new at programming and I have been trying to get everything set-up on my computer. I have installed RailsInstaller, go to >railsinstaller_demo, and type in rails s. I get the following error though could not find gem 'uglifier <>= 1.0.3> x86-mingw32'
I looked through the forum and found how to do a gem list and i noticed it was not there. I then went to gembundler and ran $ gem install bundler. I tried again but it did not work.
I am sure the answer is on this site, but i am so new that i see all these lines of code I actually have no idea where to type it in.. I am running Windows 7.
thanks for taking the time to help out a real beginner.
Have you gone to the $ railsinstaller_demo directory and run the bundle install command? This will install the gem dependencies for the application; you will not be able to run the server until you've bundled the gems. Additionally, if you're still having issues with the uglifier gem, go ahead and remove the line in the Gemfile and then run bundle install
If you need further help with the Command Prompt, you an find out more at http://bit.ly/ZajVeW.
Thanks,
Evan