luarocks install fails? - lua

I install torch following
http://torch.ch/docs/getting-started.html
But when I use luarocks to install libs, like itorch, I command
luarocks install itorch
gives
Error: Your user does not have write permissions in
/home/myname/code/torch/install/lib/luarocks/rocks
-- you may want to run as a privileged user or use your local tree with --local.
Then I cmd
sudo luarocks install itorch
gives
sudo: luarocks: command not found
Then I cmd
luarocks
gives
Configuration files:
System: /home/myname/code/torch/install/etc/luarocks/config.lua (ok)
User : /home/myname/.luarocks/config.lua (not found)
Rocks trees in use:
/home/myname/.luarocks
/home/myname/code/torch/install
So is it installed successfully ?

The first error message explains the problem: your user doesn't have write permission to the directory where you installed Torch. This is probably because you ran something as root that you shouldn't have.
You can probably fix this by running something like:
sudo chown -R myname: /home/myname/code/torch/install/lib/luarocks
sudo chmod -R u+w /home/myname/code/torch/install/lib/luarocks

Related

Installed Django but django-admin is not found

I just installed django using pip but when I try to create a new project using django-admin I get "bash: django-admin: command not found".
I tried installing django in a virtualenv but I'm still getting the same error when trying to create a new project.
While I was trying to solve this issue I found this: Installing Django with pip, django-admin not found
The last answer is saying that django-admin may not be on the path. Can anyone explain me please what does this mean?
If I run "find / -name django-admin.py" I get this:
/home/user/.local/bin/django-admin.py
/home/user/.local/lib/python3.5/site-packages/django/bin/django-admin.py
/home/user/django-admin.py
Can anyone give me some help please? Thank you.
You have installed Django using your account instead of sudo
so do the following to resolve this
$ pip3 uninstall django
$ sudo pip3 install django
This is the output
$which django-admin
/usr/local/bin/django-admin
I had the same problem. My "solution" was to call django-admin directly like
/usr/local/bin/django-admin startproject MyProject
I also experienced this error but none of the above works for me.
This is how I got this silly mistake of me. Example,
$ mkdir django_test cd django_test
$ pipenv shell
(django_test)$ django-admin startproject django_test .
zsh:command not found: django-admin
To solve this error: Don't forget to install your django version in your virtual environment first if you are using.
$ mkdir django_test cd django_test
$ pipenv shell
(django_test)$ pipenv install django==3.0.5 # change the version you are using
(django_test)$ django-admin startproject .
Just in case someone is experiencing this issue, you can just install django using apt package manager instead of pip.
I am not sure if this is the best way to do it but it worked for me.
First you need to uninstall the current installation of django. In this case you can run $ python -m pip uninstall Django
Then run $ sudo apt install python3-django
That should fix the issue.

Bower: invalid option: --allow-root

I'm having this issue on ubuntu 14.04LTS:
When I do rake bower:install:dev I get:
Error: EACCES, permission denied
'home/MyName/.config/configstore/bower-github.yml' You don't have access to this
file.
When I do sudo rake bower:install:dev I get:
bower ESUDO Cannot be run with sudo
Additional error details: Since bower is a user command, there is no
need to execute it with superuser permissions. If you're having
permission errors when using bower without sudo, please spend a few
minutes learning more about how your system should work and make any
necessary repairs.
http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814
You can however run a command with sudo using --allow-root option
When I do sudo rake bower:install:dev --allow-root I get:
invalid option: --allow-root
How do I solve this issue?
I solved it by adding .bowerrc file in the root of my app with the following content:
{ "allow_root": true }

unable to connect to chromedriver http://127.0.0.1:9515 (Selenium::WebDriver::Error::WebDriverError)

I have installed chrome-driver from http://chromedriver.storage.googleapis.com/index.html
and I have installed both Google-chrome browser also.
I want to Run cucumber test cases using chrome browser instead of Firefox browser but I am stuck with this error.
Any help appreciated.
Thanks
I had this issue because of path override with rbenv shim.
It's worth checking where which chromedriver points too.
For me the fix was:
gem uninstall chromedriver-helper and brew install chromedriver
If you using rbenv on linux machine then
copy 'chromedriver' to current using ruby versions like below -
cp chromedriver $HOME/.rbenv/versions/2.2.0/bin
Example: cp chromedriver home/abc_user/.rbenv/versions/2.2.0/bin
and then set the permissions like -
chmod +x home/abc_user/.rbenv/versions/2.2.0/bin/chromedriver
Open Terminal:
brew link --overwrite chromedriver
I have encountered after installation of ansicon1.60 for colourful screen. After uninstalling it by the following command in ansicon directory:
C:\Users\Administrator\Downloads\x64>ansicon.exe -i
after that, i decided not to use ansicon.
If you have rbenv concerns problem, you may try:
$ rbenv rehash
and then run your test again. ;)
ChromeDriver setup in Linux [Ubuntu]
Open Terminal and download Chromedriver using the cmd
$ wget http://chromedriver.storage.googleapis.com/2.7/chromedriver_linux64.zip
$ Unzip chromedriver_linux64.zip
$ cp chromedriver /usr/local/bin
$ chmod +x /usr/local/bin/chromedriver
Do not use ansicon1.60 for colourful screen.
Run cmd /d which starts the command prompt without processing its AutoRun entry, thus bypassing ANSICON. Then you should just be able to do \x64\ansicon -u.

I can't install gems with rvm

I'm new to ruby version manager and when i tried to install rails after installing it, I get this error . I tried to search other SO questions as well but didn't want to re-install ruby version manager. Even though when I try sudo for installation, it doesn't work.
The error I get is as follows:"ERROR: While executing gem ... (Errno::EACCES)Permission denied # dir_s_mkdir - /home/sunil/.gem/specs"
I would do this:
ls -ld /home/sunil/.gem/specs to check that folder permissions.
whoami to compare current user with /home/sunil/.gem/specs permissions
Maybe chown -R sunil:sunil ~/.gem to change owner in case .gem directory is not owned by sunil.
Maybe chmod -R u+rwX,go+rX,go-w ~/.gem to change permissions.

"The program 'ruby' is currently not installed" error after reboot

After the reboot which was required to update all the packages,
ruby -v
doesn't work. It says rails is not installed either, but I guess it should be the similar issue. when I do:
sudo apt-get install ruby
It says the newest version is already installed.
When I do:
dpkg -L ruby
I get the following output:
/.
/usr
/usr/bin
/usr/share
/usr/share/doc
[and other stuff..]
But I realized $PATH already includes /usr/bin:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
:/sbin:/bin:/usr/games:/home/ubuntu/.rvm/bin
May I know why I'm still getting the following error message?:
The program 'ruby' is currently not installed. You can install it by typing:
sudo apt-get install ruby
My .bashrc already has this too:
PATH=$PATH:$HOME/.rvm/bin
dpkg will be checking in a database that it maintains, whereas trying to execute ruby uses the PATH. If I recall correctly, Ubuntu has a bash handler configured to execute when any command is unresolvable; it seems that it just displays that generic message rather than checking with dpkg first.
It is possible that ruby has disappeared from your filesystem (or at least the directory it previously resided in), or that your PATH was changed.
What do you get if you execute "which ruby" and "where ruby"?
Lastly, Ubuntu can complain that a program cannot be found when it is present. This occurs when running a 64-bit version of Ubuntu, without the necessary x86 libraries installed, and trying to execute a 32-bit binary. However, I recall the error message being more along the lines of "file not found".

Resources