Migrating Tumblr to octopress (Jekyll) - in wrong directory - ruby

I'm trying to migrate a blog from Tumblr to Octopress.
When I run in the octopress directory
ruby -rubygems -e 'require "jekyll/migrators/tumblr"; Jekyll::Tumblr.process("http://example.org", format="md")'
It starts running but then complains about what folder it's in
/usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/convertible.rb:27:in `read': No such file or directory - /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/../_posts/tumblr/2012-08-28-how-to-add-your-picture-to-google-results.md (Errno::ENOENT)
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/convertible.rb:27:in `read_yaml'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/post.rb:39:in `initialize'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:124:in `new'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:124:in `block in rewrite_urls_and_redirects'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:119:in `map'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:119:in `rewrite_urls_and_redirects'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:30:in `process'
from -e:1:in `<main>'

Here's a quick and dirty fix that worked for me (doesn't apply if you don't have root access, obviously), but it will get the job done.
Here's your error message for reference:
/usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/convertible.rb:27:in `read': \
No such file or directory - \
/usr/lib/ruby/gems/1.9.1/gems/jekyll0.11.2/lib/jekyll/migrators/../_posts/tumblr/2012-08-28-how-to-add-your-picture-to-google-results.md (Errno::ENOENT)
The full path in the exception is:
/usr/lib/ruby/gems/1.9.1/gems/jekyll0.11.2/lib/jekyll/migrators/../_posts/tumblr/2012-08-28-how-to-add-your-picture-to-google-results.md
Here's the solution:
1. cd to /usr/lib/ruby/gems/1.9.1/gems/jekyll0.11.2/lib/jekyll/migrators/
2. cd ..
3. ln -s %{DIRECTORY_WHERE__posts_LIVES}
4. Re-run your migration command
Just creating this symlink fixes the issue but it's an obvious and total hack.

Does the file /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/_posts/tumblr/2012-08-28-how-to-add-your-picture-to-google-results.md exist? If not maybe you could just move your posts to that folder first, just as a simply workaround.

Related

Xcode Project Navigator, Cannot access Project

I am struggling a lot with this. And I know that the answer is staring me in the face somewhere but no matter what I search or look up and try, nothing works.
My schemes are all pointing to my pod frameworks and I cannot select the project target, even if I try and add a new scheme or edit an old one.
My project navigator starts with a folder as shown above, and I have NO idea how to revert back to whatever I had done to get it like this.
If anyone has any suggestions please help.
I cannot access target build settings or project build settings, Is there a way to access them without going through the project navigator ?
I cannot build properly as shown from the schemes, is there an easy fix to this ? Have I somehow changed the target path to an incorrect file location? How to revert back ?
I'm stuck :(
UPDATE:
deleting the .xcworkspace file and reinstalling the podfile gives below error code.
```
RuntimeError - [Xcodeproj] Unknown object version.
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project.rb:218:in `initialize_from_file'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project.rb:103:in `open'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/analyzer.rb:918:in `block (2 levels) in inspect_targets_to_integrate'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/analyzer.rb:917:in `each'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/analyzer.rb:917:in `block in inspect_targets_to_integrate'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/user_interface.rb:64:in `section'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/analyzer.rb:912:in `inspect_targets_to_integrate'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/analyzer.rb:78:in `analyze'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:243:in `analyze'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/user_interface.rb:64:in `section'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:116:in `install!'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/command/install.rb:41:in `run'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/command.rb:52:in `run'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/bin/pod:55:in `<top (required)>'
/Applications/CocoaPods.app/Contents/Resources/bundle/bin/pod:22:in `load'
/Applications/CocoaPods.app/Contents/Resources/bundle/bin/pod:22:in `<main>'
```
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=%5BXcodeproj%5D+Unknown+object+version.&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
- RuntimeError - [Xcodeproj] Unknown object version.
https://github.com/CocoaPods/CocoaPods/issues/6992 [closed] [16 comments]
31 Jan 2019
- - ERROR | [iOS] unknown: Encountered an unknown error (Malformed version number string ) during validation.
https://github.com/CocoaPods/CocoaPods/issues/8240 [closed] [16 comments]
12 hours ago
- Xcodeproj doesn't know about the following attributes {"inputFileListPaths"=>[], "outputFileListPaths"=>[]} for the 'PBXShellScriptBuildPhase' isa
https://github.com/CocoaPods/CocoaPods/issues/7835 [closed] [46 comments]
2 hours ago
and 44 more at:
https://github.com/cocoapods/cocoapods/search?q=%5BXcodeproj%5D%20Unknown%20object%20version.&type=Issues&ut
SOLUTION:
To my particularly specific problem, I had permission issues with the RUBYGEMS that is installed by default on all MAC devices.
I was not able to rebase my project to its original state as I did not have "write privileges". I had to install homebrew and rbenv which allowed me to (after deleting my cocoapods out of the project entirely) rebase my project to its original state before whatever I had done to rebase the file target to something else.
After installing Homebrew and Rbenv I installed a newer version of RubyGem which gave me admin permissions on the new install. Then I reinstalled cocoapods to the project and VOILA. Problem solved.

How to fix (RubyInstaller::Runtime::DllDirectory::WinApiError) in ruby on windows?

while Implementing ruby2d in the code i get this error
It's a strange runtime issue
Ruby2d Code
require 'ruby2d'
# Set the window size
set width: 300, height: 200
# Create a new shape
s = Square.new
# Give it some color
s.color = 'red'
# Show the window
show
Error
8: from R.rb:1:in `<main>'
7: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:39:in `require'
6: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
5: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in `require'
4: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/ruby2d-0.5.1/lib/ruby2d.rb:28:in `<top (required)>'
3: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/ruby_installer/runtime/singleton.rb:12:in `add_dll_directory'
2: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/ruby_installer/runtime/singleton.rb:12:in `new'
1: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/ruby_installer/runtime/dll_directory.rb:50:in `initialize'
*C:/Ruby25-
x64/lib/ruby/site_ruby/2.5.0/ruby_installer/runtime/dll_directory.rb:83:in
`add_dll_directory_winapi': AddDllDirectory failed for
C:/Users/Salim/usr/local/bin
(RubyInstaller::Runtime::DllDirectory::WinApiError)*
Please Help me to fix
You have to run your project from the MINGW 64-bit command prompt. Not from the regular DOS prompt (Windows Command Prompt).
Make sure you follow the instructions here:
http://www.ruby2d.com/learn/windows/
Note the last paragraph:
Using Ruby 2D on Windows
When working with Ruby 2D, make sure to use a MinGW 64-bit command prompt, rather than a standard one (cmd.exe) or the “Start Command Prompt with Ruby” found in the Start menu.
Fixed this issue by creating usr/local/bin folders in the C/users/username directory
and pasted the dlls required which can ne found on Link for dll
extract it and copy the dll from bin and paste in the new bin directory that you have created .
Imp- usr/local/bin was my default dll-load directory i hope its the same for others too but please check the error message properly.

Can't load Metasploit after installation

After istallation of Metaploit via darkoperator/MSF-Installer try to start the msfconsole and it return:
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- /usr/local/bin/config/boot (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/bin/msfconsole:23:in `<main>'
using:
Linux ubuntu 3.13.0-32-generic
Have someone an idea?
For me it helped following:
sudo chmod o+r /var/lib/gems/1.9.1/gems/robots-0.10.1/lib/robots.rb
after that user is able to run metasploit.
As user4170357 but with a slight difference due to: Mac OS X 10.9.5
to fix, run:
sudo chmod o+r /Library/Ruby/Gems/2.0.0/gems/robots-0.10.1/lib/robots.rb
(path is a little bit different than original answer)
This is a bug in the kernel where file-system becomes read-only or inaccessible randomly. Read more here.
To fix Just reboot and it will be fixed.
From http://techlogbook.wordpress.com/2014/08/19/installing-metasploit-on-xubuntu-14-04/
$ msfconsole
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- /usr/local/bin/config/boot (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /usr/local/bin/msfconsole:23:in `'
What I did was to edit /usr/local/bin/msfconsole line 23, and replace that line with:
require File.expand_path('/usr/local/share/metasploit-framework/config/boot.rb', __FILE__)
Make sure that the path for config/boot.rb is correct for your system.
Now, when I run msfconsole again, it gives me some warning of missing permission to write some log file.
Rails Error: Unable to access log file. Please ensure that /usr/local/share/metasploit-framework/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
So I need to create the directory and make sure it is accessible.
$ cd /usr/local/share/metasploit-framework/
$ mkdir log
$ chmod 777 log
Now, I can run msfconsole. Before reaching the prompt, however, I got the following warning:
[-] WARNING! The following modules could not be loaded!
[-] /usr/local/share/metasploit-framework/modules/auxiliary/scanner/smb/smb_login.rb: LoadError cannot load such file -- robots`
Maybe that can help you get started
this might be becuase you bundled or installed metasploit as root you might need to get root access to run metasploit

Iconv will be deprecated in the future

I tried to read an excel file using this code:
require 'rubygems'
require 'parseexcel'
workbook=Spreadsheet::ParseExcel.parse("D:/TEST.xls")
and I faced the following error:
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead. default formats are encoded in ISO-8859-1
C:/Ruby193/lib/ruby/gems/1.9.1/gems/parseexcel-0.5.2/lib/parseexcel/olestorage.rb:108:in `initialize': No such file or directory - D:/TEST.xls (Errno::ENOENT)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/parseexcel-0.5.2/lib/parseexcel/olestorage.rb:108:in `open'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/parseexcel-0.5.2/lib/parseexcel/olestorage.rb:108:in `initialize'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/parseexcel-0.5.2/lib/parseexcel/parser.rb:173:in `new'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/parseexcel-0.5.2/lib/parseexcel/parser.rb:173:in `parse'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/parseexcel-0.5.2/lib/parseexcel/parseexcel.rb:10:in `parse'
from lkc.rb:4:in `<main>'
What is the problem, and why can't I read the excel file?
I think the actual error message is this, on the second line:
No such file or directory - D:/TEST.xls (Errno::ENOENT)
Try D:\TEST.xls or D:\\TEST.xls instead.
The title is misleading, this "Iconv will be deprecated in the future" is not the real issue - it's just a warning. As #brandon-tilley says, the problem is that the file you are trying to open does not exist. Try opening IRB, and typing File.open("D:\Test.xml") etc until you do not get an error message. Then you know the file exists and the path is correct, and you can continue debugging other aspects (if there are still errors).

Ruby: What does Errno::EEXIST mean when installing a gem?

I am trying to install a ruby gem called activeldap, however, it won't let me install it. I keep getting all kinds of errors including the Errno::EEXIST error. I added the error info below. Any ideas?
C:\Ruby\www\demo>gem install activeldap
ERROR: While executing gem ... (Errno::EEXIST)
File exists - C:
C:\Ruby\www\demo>gem install activeldap --debug -V
Exception `NameError' at C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:164 - uninitialized constant Gem::Commands::InstallCommand
Exception `NoMethodError' at C:/Ruby187/lib/ruby/1.8/rational.rb:78 - undefined method `gcd' for Rational(1, 2):Rational
Exception `Gem::LoadError' at C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:779 - Could not find RubyGem test-unit (>= 0)
Exception `Gem::LoadError' at C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:779 - Could not find RubyGem sources (> 0.0.1)
GET http://rubygems.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - File exists - C:/Users/ktemplar/.gem/specs/rubygems.org%80
GET http://rubygems.org/specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/specs.4.8.gz
304 Not Modified
Installing gem locale-2.0.5
Exception `IOError' at C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/format.rb:50 - closed stream
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - File exists - C:/Ruby187/lib/ruby/gems/1.8
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - File exists - C:/Ruby187/lib/ruby/gems/1.8/gems/locale-2.0.5
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - File exists - C:/Ruby187/lib/ruby/gems/1.8/gems/locale-2.0.5/lib
C:/Ruby187/lib/ruby/gems/1.8/gems/locale-2.0.5/lib/locale.rb
Exception `Errno::ENOENT' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - No such file or directory - C:/Ruby187/lib/ruby/gems/1.8/gems/locale-2.0.5/lib/locale/tag
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:243 - File exists - C:
Exception `Errno::EEXIST' at C:/Ruby187/lib/ruby/1.8/fileutils.rb:219 - File exists - C:
ERROR: While executing gem ... (Errno::EEXIST)
File exists - C:
C:/Ruby187/lib/ruby/1.8/fileutils.rb:243:in `mkdir'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:243:in `fu_mkdir'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:217:in `mkdir_p'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:215:in `reverse_each'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:215:in `mkdir_p'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:201:in `each'
C:/Ruby187/lib/ruby/1.8/fileutils.rb:201:in `mkdir_p'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:517:in `extract_files'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:500:in `each'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:500:in `extract_files'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:196:in `install'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:277:in `install'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:247:in `each'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:247:in `install'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:119:in `execute'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:116:in `each'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:116:in `execute'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/command.rb:270:in `invoke'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:134:in `process_args'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in `run'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:58:in `run'
C:/Ruby187/bin/gem:21
Update 13 July 2010
It is very likely that this problem is caused by installation of E Text Editor on Windows 7. In order to provide compatibility with TextMate on Windows, E automatically installs Cygwin. During installation a bash script is run which tries to modify permissions on C:. Here's the line:
chmod o-w `cygpath $HOMEDRIVE`
Apparently when Cygwin sets permissions, it is making a mess of the Windows ACL
permissions. In order to protect the integrity of the system root drive, Windows UAC does something known as Virtualization or Data Redirection. More info here. In our case, instead of messing up the permissions on the real root directory, Virtualization kicks in and corrupts permissions on the VirtualStore (%localappdata%\VirtualStore) directory instead, making its root inaccessible (although any directories within remain untouched and accessible). When Ruby installs gems it tries to access the root C:\ directory, which UAC disallows, so it tries to access %localappdata%\VirtualStore, which it can't if you have corrupt permissions, thus you get the failure.
You can fix this by removing the bad permissions from VirtualStore (you'll need to unhide protected system files in Explorer to see VirtualStore). The correct permissions should inherit from the parent folder and should be:
SYSTEM (full control)
*your users* (full control)
Administrators (full control)
Here's a gist comparing the broken permissions vs the correct permissions:
http://gist.github.com/471087
The author of E is aware of this problem and working on a fix.
This seems to be a weird permissions error that is apparently only occurring on Windows 7. Try opening an elevated command prompt and installing from there. Here's what I get when elevated:
[C:\Users\charlesr]gem install activeldap
Successfully installed activeldap-1.2.2
1 gem installed
Installing ri documentation for activeldap-1.2.2...
Installing RDoc documentation for activeldap-1.2.2...
If I run from a standard command prompt, I get this:
[C:\Users\charlesr]gem install activeldap
ERROR: While executing gem ... (Errno::EEXIST)
File exists - C:
I'll update this answer if a better solution comes to light. It never has been a requirement to elevate when installing gems on Windows and so the behaviour we're seeing here is wrong.
There is a discussion related to this issue here: http://groups.google.com/group/rubyinstaller/browse_thread/thread/df7b7c217ad7d882
This is a file-system error on a mkdir call. The author of this gem wrote their file path code in such a way that it breaks on win32 with backslashes instead of forward slashes, resulting in a busted mkdir call. Looks like your gem isn't supported on win32.

Resources