How can I remove a gem from my Rails 3 project without getting this really strange Bundle error? - ruby-on-rails-3

The error is:
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control
WHAT VERSION CONTROL? Why/how does Bundle know anything about version control? I just removed a line from my Gemfile. Am I not supposed to do that?

Do rm -rf .bundle && bundle install from your project root.

Related

Xcode builds successfully a corrupted archive, not showing in organizer, as soon as cocoapods installs react-native-mapbox-gl from Podfile

The problem seems not new, as here, but the solutions proposed didn't work.
I tried also several other approaches to understand what's going on (see here).
To replicate, this is the process:
I have a working iOS App written in Swift.
I follow the description to integrate this app with Native React this procedure
I add to the package.json the following dependencies, and run yarn install:
"#react-native-mapbox-gl/maps":"^8.1.0-rc.9",
"prop-types": "^15.6.2",
I run pod install --repo-update and Archive on Xcode.
OUTPUT: At this point the organizer displays my Archive.
I implement a basic view on mapbox following this procedure
I add to the Podfile requiring use_framework!, as described here or after use_framework!, no difference in the result after I hit pod install --repo-update.
I hit Archive on Xcode.
OUTPUT: the archive is generated successfully, but doesn't show up on the organizer. If I try to open it, the archive is corrupted.
If I remove the pod file of mapbox and I Archive the project after hitting pod install --repo-update, the archive works and shows up in the organizer. Here the same description.
The project runs both as debug and release on a real iPhone 8. Mapbox works well. However, it doesn't work on simulator, nor archive. I can leave with the former, but I can't push on App store because of the latter.
I would not give up as Mapbox is very nice and provides lots of features. What could it be?
SOLUTION :
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.9.3
rm Podfile.lock
rm -rf Pods
pod install
LAST MESSAGES :
Same here. Impossible to find any solution.
Xcode is building a incomplete archive file. (By incomplete, I mean that in the archive package, some files are missing, like info.plist)
If this can help, I'm using MapboxGL too.
Edit :
Found this https://github.com/react-native-mapbox-gl/maps/issues/1097#issuecomment-725689831
Edit 2:
This link was the solution !
I got the exact same problem with :
#react-native-mapbox-gl/maps": "8.1.0"
COCOAPODS: 1.10.1
Xcode 12.4
The archive was corrupted (missing parts like the plist)
The trick for me was to remove the copy dsym build phase of the #react-native-mapbox-gl-mapbox-static pod
This phase was causing build failure with some config and malformed archive with others, I don't really get the crux of the problem but may be it can help some of you...
It looks like mapbox issue. I had the same issue and instead of downgrading the cocoapods I used this solution:
Edit your package.json, set:
"#react-native-mapbox-gl/maps": "^8.2.0-beta1",
2. Run yarn install or npm install.
3. Put the code into your ios/Podfile between pre_install do |installer| and end:
$RNMBGL.pre_install(installer)
And between post_install do |installer| and end:
$RNMBGL.post_install(installer)
Run cd ios && pod install
After these steps I was able to generate to archive.

How to run pod file in iOS directory in react native?

error Could not find "Podfile.lock" at projects\reactNative\ios\Podfile.lock. Did you run "pod install" in iOS directory?
(node:11696) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
error Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues. Run CLI with --verbose flag
Issue 1
For fixing the issue:
Could not find "Podfile.lock" at projects\reactNative\ios\Podfile.lock. Did you run "pod install" in iOS directory?
Please make sure you have install cocoapods and run this command at your project root:
gem install cocoapods // If you haven't install cocoapods
cd ios && pod install && cd ..
Issue 2
For fixing the issue:
(node:11696) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use node --trace-warnings ... to show where the warning was created)
Please downgrade your node.js version to v13.x.x, one of the solutions below:
npm install -g n
sudo n 13.13.0
Issue 3
For fixing the issue:
Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues. Run CLI with --verbose flag
Please make sure you have installed Xcode correctly from App Store and use the latest React Native version in your project (should be v0.62.2 now for stable). If still cannot open the project, please try to add some simulator in Xcode's developer settings.
Cheers!
you did not install cocoapods
install cocoapods commands
sudo gem install cocoapods
after that in react native directory
cd ios && pod install && cd ../ && react-native run-ios
CocoaPods manages library dependencies for your Xcode projects. We need it to setup the iOS project. Like yarn
sudo gem install cocoapods
The Podfile is a specification that describes the dependencies of the targets of one or more Xcode projects. Like package.json
access to the folder with Podfile, run
pod install
This will resolve the code of those dependency framework, and generate Pods.xcodeproj for your iOS project.

AppCenter doesn't seem to run pod install despite existence of Podfile

I've got a react-native app that builds on AppCenter. I have a Podfile in my /ios directory, and locally, I can run pod install. The AppCenter documentation says that "App Center scans the selected branch and if it finds a Podfile, it will automatically do a pod install step at the beginning of every build. This will ensure that all dependencies are installed.", but as far as I can tell, it's not running pod install for my build and the build fails for that reason.
Tried adding pod install to a pre-build script, in which case the build succeeds.
Make sure the Cocoapods version running on the build agent matches the one on your podfile.lock.
You can add a post clone script like this on your ios/ folder:
appcenter-post-clone.sh This will automatically install the matching cocoapods version.
Push that file to your repo, then make sure you open the build configuration and hit Save and Build.
It appears that in addition to having a Podfile, you must NOT have a ios/Pods folder present. In my case, I also had to explicitly add that folder to my .gitignore

The --deployment flag requires a Gemfile.lock

I have spent couple of hours but unable to solve this problem.
When I try to deploy my local rails app to production server using capistrano I get the below error:
The --deployment flag requires a Gemfile.lock. Please make sure you have checked your Gemfile.lock into version control before deploying.
Any idea on how to solve this?
My rails application folder is under version control using Git. I have pushed the local git repo to github and the Gemfile.lock is there on github. So it is under version control. However capistrano continues to give the same error.
Deploy.rb file: https://gist.github.com/brahmadpk/4748991
Remove BUNDLE_FROZEN: "true" from .bundle/config file and run bundle again.
Make sure there is nothing in the releases folder that is not a release. See this comment on a bundler issue for more details.
This blogpost titled Capistrano Deployment Trouble explains the same issue.
EDIT TO INCLUDE CONCLUSION FROM DISCUSSION IN COMMENTS
The deploy_to param was not set to an absolute path; hence capistrano wasn't able to find the folder to deploy, causing this error message.
I solve this with:
set :bundle_gemfile, "your_app_name/Gemfile"
in the deploy.rb
Run bundle and add your Gemfile.lock to your version control.
I had the same problem, even though I had no files or folders in the releases folder. Turned out it was a silly little thing: the gemfile.lock file in my repo was in lowercase for some reason, while capistrano needs Gemfile.lock with a capital G.
This is how I solved it:
Delete gemfile.lock
Delete gemfile.lock from you repo (git rm ...)
run bundle install
add the new Gemfile.lock file to your repo: git add Gemfile.lock
remove the folders from the server (don't know if this is really needed, did it anyway)
deploy
After adding bundle config unset deployment this line in the terminal, bundle install started working again for me.
I am getting exactly the same problem.
There is nothing in my releases folder (at all - my deploy cold keeps rolling back).
My gemfile.lock is checked in to Subversion.
I get:
** [out :: localhost] The --deployment flag requires a Gemfile.lock. Please make sure you have checked your Gemfile.lock into version control before deploying.
Is there any way to stop the rollback so that I can see what the releases folder looks like at the time it tries to run
cd /var/qlarity/releases/20130222003607 && bundle install --gemfile /var/qlarity/releases/20130222003607/Gemfile --path /var/qlarity/shared/bundle --deployment --quiet --without development test
Later....
I found that I could prevent the rollback by commenting out the code as shown from
gems\capistrano-2.14.1\lib\capistrano\recipes\deploy.rb
task :update_code, :except => { :no_release => true } do
# on_rollback { run "rm -rf #{release_path}; true" }
strategy.deploy!
finalize_update
end
This enabled me to examine my releases folder and sure enough, there was no Gemfile.lock in it. Turns out I have ended up with an unnecessary folder in my Rails project file structure so that instead of
myapp/trunk/app
myapp/trunk/config
...
myapp/trunk/Gemfile
I had
myapp/trunk/myapp/app
myapp/trunk/myapp/config
...
myapp/trunk/myapp/Gemfile
This meant I ended up with a folder containing my Gemfile
releases/nnnn/myapp
and bundle was looking for Gemfile in
releases/nnnn
When I changed my Capistrano config from
deploy.rb
set :repository, "file:///D:/_SVN//myapp/trunk"
to
deploy.rb
set :repository, "file:///D:/_SVN//myapp/trunk/myapp"
now all is good. Really should look at fixing the folder structure next!

'pod install' doesn't update an existing pod

I am trying to update my pod using pod install and finding that it doesn't update properly unless I delete the original pod.
Is there some extra step required or is there a common mistake that makes updates fail?
I'm not sure from which version, but if you update your cocoapods installation to the latest version, you'll find two new commands to help with this.
pod outdated
This will list all pods that have updates available.
pod update
This will update the pods listed in the previous command
You can add the verbose tag and see if there is an error showing up during the update.
pod install --verbose
Using --verbose is the best way to find out what is going on. Maybe there is a problem with the repo it is trying to update from. Hard to say.
I think reader of this Question must understand difference between
pod install vs. pod update
Many people starting with CocoaPods seems to think that pod install is only used the first time you setup a project using CocoaPods and pod update is used afterwards. But that's not the case at all.
Use pod install to install new pods in your project. Even if you already have a Podfile and ran pod install before; so even if you are just adding/removing pods to a project already using CocoaPods.
Use pod update [PODNAME] only when you want to update specific pod to a newer version.
Use pod update only when you want to update every pod to a newer available version.
Every time the pod install command is run — and downloads and install new pods — it writes the version it has installed, for each pods, in the Podfile.lock file. This file keeps track of the installed version of each pod and locks those versions.
When you run pod install, it only resolves dependencies for pods that are not already listed in the Podfile.lock.
For pods listed in the Podfile.lock, it downloads the explicit version listed in the Podfile.lock without trying to check if a newer version is available
For pods not listed in the Podfile.lock yet, it searches for the version that matches what is described in the Podfile (like in pod 'MyPod', '~>1.2')
If your project is configured correctly, you should be able to delete the entire Pods directory and run pod install. I find that this is sometimes the best solution when having issues with pods not being installed properly.
Note: If you begin getting errors such as this when you build:
diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
... you may need to close and reopen the project in Xcode.
Warning: make sure all the files in your Pods directory are going to be recreated before deleting the Pods directory. (I.e. make sure you didn't manually modify or add files to the Pods directory.)