illegal access mode 0 while deleting file in ruby - jruby

I am getting following error while deleting a file:
illegal access mode 0
and I am just using ruby File.delete.
Any suggestions please?

Its resolved cheaply.
I have used spreadsheet gem and i open a file using that. At the end when i tried to delete that file i got this error.
This is very cheap move, just i need to close that file. file was lock mode so it restricted to delete.

Related

Fatal Error when accessing /index.php/Special:Specialpages MediaWiki page

I recently upgraded our MediaWiki installation to version 1.24.2
Now when I access the Special pages at http://www.myserver.com/index.php/Special:Specialpages I get this error:
Warning: require(/www/local/path/to/web_directory/public_html/includes/specials/SpecialAllPages.php) [function.require]: failed to open stream: No such file or directory in /www/local/path/to/web_directory/public_html/includes/AutoLoader.php on line 1282
Fatal error: require() [function.require]: Failed opening required '/www/local/path/to/web_directory/public_html/includes/specials/SpecialAllPages.php' (include_path='.:/usr/local/share/pear') in /www/local/path/to/web_directory/public_html/includes/AutoLoader.php on line 1282
Can someone please point me at the right direction to solve this problem?
I have already searched the entire interweb for an answer...
PHP version: 5.3.10
MySQL version: 5.5.31
Apache version: 2.2.22
It seems there was an error while upgrading/transferring the files to your server.
It seems you solved your problem by yourself, however: You shouldn't update mediawiki's files on top of another version. Instead, you should delete the old installation (keeping the files you need like LocalSettings.php, images/ and so on) and upload a new copy of the new version you want to use. See https://www.mediawiki.org/wiki/Manual:Upgrading for a detailed upgrading tutorial. Following these steps should avoid such problems the next time :)
I found out what the problem was.
I installed v 1.24.2 on top of version 1.21
By some reason the file SpecialAllPages.php was named SpecialAllpages.php with a small 'p'.
After renaming the file to SpecialAllPages.php the same error was triggered regarding the file SpecialAllMessages.php that was named SpecialAllmessages.php
After renaming that file also, everything works fine again.

Nitrous desktop error warning

I'm on Windows. My Nitrous desktop app wont sync files. It says
"Error Warning the previous run of unison terninated in a dangerous state."
How can I fix this?
Thanks
The file transferring may not have completed properly. Try restarting the Nitrous Desktop app and try again.
If you run the app from the command line then you should see a full log message details on which files it is having issues with. If the app continuously displays this error then you may want to try removing the files which are causing the warning.
Here is a full explanation via Yahoo Groups:
There is a small window of danger while Unison is finishing
transferring a file, when the old file has been moved to a temporary
location but the new file has not been moved where it belongs. This
message is telling you that Unison got interrupted just at this moment
the last time it ran. You should check the file it's warning you
about, then delete the DANGER.README file and try again.

dbext not finding sql snippets to execute

I'm trying to use the dbext vim plugin to connect to a MySQL database.
When I give commands like <Leader>se I get an error:
Can't open file
/var/folders/b3/s3wyytf90_ld113h1w3p86ldcg4glv/T/vQ0XMX3/7
That file doesn't exist. But the SQL I expect to be executed does exist in:
/var/folders/b3/s3wyytf90_ld113h1w3p86ldcg4glv/T/vQ0XMX3/dbext.sql
So it looks as if the plugin is writing a temp file in one location and looking for it in another.
I'm sure the plugin can't be broken and I must have done something wrong, but I don't know enough Vimscript to follow it through.
I have Vim v7.3, dbext 20.00 and have just installed by unzipping the plugin zip into my .vim directory.
I've used
:DBPromptForBufferParameters
to set up my connection parameters.
The full error looks like:
dbext: Executing SQL at 13:54
Error detected while processing function dbext#DB_execSql..dbext#DB_execFuncTypeWCheck..<SNR>42_DB_MYSQL_execSql..<SNR>42_DB_runCmd:
line 24:
E484: Can't open file /var/folders/b3/s3wyytf90_ld113h1w3p86ldcg4glv/T/v0BN3Qw/7
Press ENTER or type command to continue
Can anyone point me in the right direction to resolve this?
Edit: I've since tried an install into an empty .vim directory, with all of my other config and plugins removed, so I don't think that it's a case of conflicting configuration.
I'm running MacOSX, in case it's relevant.
Dumb mistake on my part.
I was supplying a bare password which needed to be quoted in this context due to a special character.
I'm now quoting the password when prompted for it by :DBPromptForBufferParameters and everything is working.

Error while trying to build schema in symfony1.4 project

I'm trying to build up a new project with Symfony1.4.
I'm not new to Symfony but today I faced with a new problem, never seen before.
When trying to run
php symfony doctrine:build-schema
i revieve this error
Warning: mkdir(): SAFE MODE Restriction in effect. The script whose uid is 10045
is not allowed to access /tmp owned by uid 0 in /var/www/vhosts/my site.it/httpdocs/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/
doctrine/Doctrine/Lib.php on line 292
So, my question is, how can I solve this problem?
It seems that doctrine save a temporary file in /tmp dir, where I cannot access.
Can I maybe change it somewhere?
Yes. The error seems to be occurring because Symfony is trying to create a directory and it's incapable of doing so because of permissions.
If you open
/var/www/vhosts/mysite.it/httpdocs/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Lib.php
You can see this line of code on 292
return mkdir(trim($path), $mode, true);
$path contains the path to a directory that Doctrine is trying to unsuccessfully generate. It could be your mysite.it\httpdocs\data directory where the fixtures or schema.yml is kept.
Try doing a die(var_dump($path)); just before the above line to see what the path of the directory is. Then you might need to physically create it yourself on the file system.

Writing/Reading User-Defined settings in app.config file

I am trying to read and write into app.config file of user-settings. I found a snippet of a code for working with confige file. I finally got it compiling and running, but it absolutely seems to be doing nothing to the App.config file.
Here is the code:
Method MainForm1.Button1.Click(sender: System.Object; e: System.EventArgs);
var
config : System.Configuration.Configuration;
begin
config:=ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings.Add('PreferenceToRemember','value1');
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection('appSettings');
end;
It is compiling without any errors, but I don't know if it is doing anything.
Is there anything wrong with the code? I need to be able to write/read a section and write/read a key/value. Thanks in advance.
UPDATE: Instead of using ConfigurationManager, I simply use Properties.Settings.Default. However, I am having bit of a problem writing into it and reading back from it, although program complies with without any errors and the code seems simple.
How do you read and write to Properties.Settings.Default from within your code?
Maybe you're looking at the wrong file?
The app.config you have in your solution will be copied to YourProgramFile.exe.config in the bin/Debug or bin/Release folder. When running your program it will update this file, not the app.config file in your solution.
Then perhaps you also should check write permissions on your application folder. Normally (Win Vista, Win 7) the User executing an application does not have write permissions in the Program Files folder where your application should reside, so updating the .config will most probably fail due to the lack of write permissions. This is even more true for Linux/Unix systems.
You should try to separate the elements you need to write and write an additional config file in a user-specific folder. You can take the defaults from the normal application config for that initially and just update the user-specific config file, this way you are not hindered by file permissions and every user can update their settings specifically.