Conflicting names error when installing Alamofire pod - swift3

I created an app with a watch and a today extension running Xcode 8.2.1. with Swift 3. For all targets, I want to use Alamofire to fire up requests. This worked perfectly fine with the iOS app and the Watch Extension, but pod install throws following error when trying to add it to the today target:
The 'Pods-xY' target has frameworks with conflicting names: alamofire.
Here's my podfile:
target 'xY' do
use_frameworks!
pod 'Alamofire', '~> 4.4'
end
target 'xYToday' do
use_frameworks!
pod 'Alamofire', '~> 4.4'
end
target 'xYWatch Extension' do
use_frameworks!
pod 'Alamofire', '~> 4.4'
end

I ran into the same issue, just today. Apparently it is not possible to use the same framework in a today extension and in an app. See this comment.
Cocoapods should give a decent error message, which is a bug, but for now, only Apple could fix this like both you and I would have expected, see this comment by the same guy later in the thread.
Bummer!

Related

No such module 'IBMCloudAppID' in xcode 10.2 Swift

I am trying to use IBMCloudAppId is my swift project and getting an error when I am trying to import IBMCloudAppID in my xcode 10.2.
I followed these steps as
Open your Xcode project and enable Keychain Sharing (Under project settings > Capabilities > Keychain sharing)
Under project setting > info > Url Types, Add $(PRODUCT_BUNDLE_IDENTIFIER) as a URL Scheme
Add the following import to your AppDelegate.swift file:
import IBMCloudAppID
Getting an error
No such module 'IBMCloudAppID' in xcode 10.2
And my POD file looks like
use_frameworks!
def shared_pods
platform :ios, '10.2'
pod 'BMSCore', '~> 2.3.1'
pod 'JOSESwift', '~> 1.1.0'
pod 'IBMCloudAppID'
end
target 'IBMCloudAppID' do
use_frameworks!
pod 'IBMCloudAppID'
shared_pods
end
target 'IBMCloudAppIDTests' do
shared_pods
end
Looks like you haven't installed pods in the application.
Try with the following steps which should resolve the issue.
Install Cocoapods in your machine
Run pod install in the terminal at the root of your app project.
open your-project.xcworkspace in Xcode
Clean and Build the app
Answer to this question
And after opening workspace, build library first and then project.

Remove therubyracer or fix timeout when pushing to Heroku

We've been wanting to upgrade our app to Ruby 2.1.5. We use Heroku as our deployment service and Rails 4.0.13. When we push into Heroku, we're getting the following error:
Could not find libv8-3.3.10 in any of the sources
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
This is because we're using the therubyracer gem, in its 0.10.2 version. That version depends on libv8 version 3.3.10, which apparently isn't available for Ruby 2.1 (because when using Ruby 2.0, we don't get this issue). We could upgrade to the latest therubyracer version, 0.12.1, but this gives us:
Timed out compiling Ruby app (15 minutes)
almost all the time whenever we push. Also, this gem is not recommended for Heroku (therubyracer in Heroku). Which of course lead us to wanting to remove it.
However, we're also using less-rails for our project. This gem depends on therubyracer https://github.com/metaskills/less-rails#installing). This makes it difficult for us to remove therubyracer. One way to solve this is to stop using less and begin using sass, but we want to avoid that as much as possible.
Is there any way to remove therubyracer and still use less-rails? If not possible, can we avoid the timeouts when pushing?

PG pg_ext load error in rails

I recently updated to rails 4.1.6 and ruby 2.1.3p242. I also updated all gems on my system. After creating a new app, I keep getting a pg_ext load file error on running the server. I'm on windows 8 x64 with PostgreSQL 9.3. The pg gem was working fine under my previous RoR installation which was rails 3.2 and ruby 1.9.3.
Under the gem's installation directory, I've a 2.0/pg_ext.so file. I tried renaming the folder to 2.1 and ran the server. The result was the same. I assume it's cause Ruby doesn't allow to Require a .so file. Below is the screenshot of the error:
Any help would be really appreciated. Thanks!
Posted question on the official Gem page:
https://bitbucket.org/ged/ruby-pg/issue/192/pg_ext-load-error
As per the suggestion, I installed the pre-version of the next release. That gave me another error which was solved using:
https://github.com/tzinfo/tzinfo/wiki/Resolving-TZInfo::DataSourceNotFound-Errors
TZInfo::DataSourceNotFound error starting Rails v4.1.0 server on Windows
Posting the answer to help people facing similar problems in the future.
1) In the command line enter:
gem install pg --pre
gem list pg
2) In the Gemfile set the gem to the newly installed version:
gem 'pg', '~> 0.18.2'

bundle cannot find the global shared gem in nginx/passenger

The passenger reports error that the gem json cannot be found. While other gems can be found because they are installed by bundle install. However, json was default installation by ruby 2.1.1.
And it is wired that bundle shows json has been deleted.
$ bundle show json
The gem json has been deleted. It was installed at:
/home/canoe/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/json-1.8.1
But gem can still find it on system.
$ gem list json
json (1.8.1)
And json is installed at this location /home/canoe/.rbenv/versions/2.1.1/lib/ruby/2.1.0/json.rb.
I don't use cap while deploying the rails4.1 application, so this solution doesn't work for me.
I don't want to package everything into somewhere, instead to use all current installed gems in the gemsets.
So, how to make bundle use system default gems in nginx passenger?
I encountered the same issue, but following post helped me: fusion passenger issue with json gem when running on nginx
Maybe you are also using some ruby version control tool. As I'm using RVM.
According to the comment in above post. passenger_ruby need to be pointed to the RVM wrapper folder.
eg:
passenger_ruby /usr/local/rvm/wrappers/ruby-2.0.0-p481/ruby;

Get 'best-in-place' gem for rails4 from github w/o internet

I got a very limited internet connection on my office laptop and I want to install the 'best-in-place' gem. Since I use rails 4 I need to get the gem from github as far as I understood various threads. But I cant run bundle install with access outside of my local system.
Is it still possible to install that gem somehow? I already downloaded the folder form github and put it into my ruby but its not working that easy.
Best regards!
Edit: If thats not possible, does anyone of you uses an alternative gem with similar functions?
You can always clone it (or download it, as you have) and then access it later.
Let's say that you downloaded it to: /home/user3665315/workspace/best_in_place
Then, in your Gemfile you can access it locally with the :path option
# Gemfile
gem "best_in_place", path: "/home/user3665315/workspace/best_in_place"
then run
bundle install
and that's it, you have it working locally