Missing Gemfile.lock on creation of rails application - ruby-on-rails-3

While creating a Rails application:
user$ rails new App
All the other files get created, i.e. app, config, db, doc, script, test, Gemfile, etc I find that the Gemfile.lock fails to be created. Any particular reason why this could be happening? I am facing errors in bundling gems, though I do not know whether the absence of the Gemfile.lock file is causing this. Please help!

you dont get a lock until after you do your bundle, and whenever there is a well form group of gems built (with all dependancies available..)
if you run:
bundle install
I think one should get created for you.
or
bundle update
if you have a lock file and have an updated gemset

Related

Cocoapods Errors : Resource.sh not found

Folks,
Cocoapods : 0.39.0
FYI I have done enough research and I was able to take care of errors like:
Podfile.lock not found.
.menifest not found
and others while building my project.
Which still seem hack to me but as long as they let me build I dont care.
But one real problem is this :
Pod-resources.sh not found and this one is in the pod directory.
so for sure Its not in my source control as I dont check in pods dir into my project.
I have done more than enough weokspace deletion, podlock deletion, who pods dir deletion and pod install. but this problem is still there.
I am using apptentive which has a resource bundle, which need to be copied to the app binary.
At the moment I have disable Apptentive thru out the project to speed up the development and keep looking for solution.
Links that I have read are follows :
https://github.com/CocoaPods/CocoaPods/issues/2303
is from July 10, 2014 : seem too old to rely on.
CocoaPods Errors on Project Build
Error:"The sandbox is not in sync with the Podfile.lock..." after installing RestKit with cocoapods
The sandbox is not in sync with the Podfile.lock-ios
Error:"The sandbox is not in sync with the Podfile.lock..." after installing RestKit with cocoapods
How I solved my partial problem : delete workspace file, Pods Dir and .lock file. If this can help anybody.
Culprit was the path. It seem how Cocoapods is handling is different than earlier.
What it dont do is updating your project file for Copy Resources phase:
it seems they have update the path and now it has "/Target Support Files/Pods-ProjectName/" in it.
Older path: "${SRCROOT}/Pods/Pods-ProjectName-resources.sh"
New Path: "${SRCROOT}/Pods/Target Support
Files/Pods-projectName/Pods-Project-resources.sh"
So if you are having same errors like me you need to do is :
remove workspace file
remove .podlock file
remove .menifest file
do Pod install
update the path in build phase in xcode project file as shown above.
Now Build the project/workspace
Hope this will save someone's time.
You might have to add a PODS_ROOT user-defined build setting, as described here.

Rails and Bundle for production with Passenger missing assets

We're having a small issue with our app. Currently we've made an update of the internal design and uploaded to the server, however running the following;
RAILS_ENV=production bundle exec rake assets:precompile
only precompiles certain items into the asset folder under public directory. Anyone else ran into the problem like this with suggestion how to fix. We have everything set correctly in environments and initializers.
Sounds like some files are not getting into the precompile list. Try adding this to your config/application.rb
config.assets.precompile = [/^[^_]/]
This should be a catch all that will pick up all your js and css. Let me know if that works for you guys. Also you should be sure to tell that guy that you are listening to that deploying via FTP is silly.

Cocoapods: how to create own pods for 3rd party library?

I am using Cocoapods, and one of the libraries I use is ZUUIRevealController, currently the version is 0.9.6 in Cocoapods, which is not the latest one, if I want to create my own pods for that, what are the steps for doing it?
Thanks!
To update for everyone:
OK, so all the cocoapods are held inside a big specs repository Here. We want to go down to the ZUUIRevealController part of the repo. We can see just the 0.9.6 which is how cocoapods knows what version it is.
So, fork the cocoa pods spec repository and open the folder in SublimeMate Pro. You're going to want to add the next version to this folder, so let's say you were going to use 0.9.7. Make a folder for that and copy it over ZUUIRevealController.podspec from version 0.9.6.
The new podspec will need some changing as it refers to the git tag "v0.9.6" and ideally you want to use 0.9.7. Now I've checked for you, there isn't a 0.9.7 which means you'll have to create an issue asking for a new tag, which someone has already done.
With the new tag in the repo you can move that tag into your podfile. Then in the Specs directory run pod specs lint ZUUIRevealController which will tell you whether your podspec has passed or failed linting. If you don't do this it will be done automatically on your pull request, and it's likely that it will be me telling you how to fix it.
If it passes, you can then commit that change and submit a pull request to the Cocoapods/Specs repo on github.
To update for just you:
in your podspec, you can set the commit that you want to override the normal podfile's commit with ( for example )
pod 'ZUUIRevealController', :git => 'git://github.com/orta/ZUUIRevealController', :commit => 'd4c9d810e0f0d1982472c8d1d5469841b09854ab'
This may require deleting your Pods directory first as it might have cached the url / commit.

Unpack refinery gems in rails project

I tried rake gem:unpack but I get task not found. I would like to have refinery gems in my /vendor directory to be able to see the never ending views and partials and may be modify them.
I'm still learning how to do things the "Rails way", but I feel your need to have the files in a directory that's easy to see. One command I found that will dump in vendor in the local project is bundle install --deployment. You'll need to run this after initially doing a bundle install.
run bundle package
more here: http://gembundler.com/bundle_package.html

In Ruby on Rails, why is "bundle install" so slow to create Gemfile.lock and "rails g foo name:string" creates it so quickly?

I already have all the gems, and each time I do
rails trytry02
cd trytry02
bundle install
to create the Gemfile.lock, it takes a long time to fetch data from rubygems.org. But I noticed that if I do a
rails g scaffold foo name:string
before doing the bundle install, then the Gemfile.lock is created very fast. Is there a way to create it fast but not using rails g scaffold?
Douglas is correct, this is because bundle install is doing a round trip to rubygems.org to look for newer versions. If you want to just use the local versions...
bundle install --local
But - why are you generating your Gemfile.lock so often that this is an issue? Your Gemfile.lock should be under version control, ie. part of your project, and so should only change occasionally.
Try to change https to http in the Gemfile and see if this increases its speed.