Ask A Question

Notifications

You’re not receiving notifications from this thread.

Setup Windows 10 Discussion

Chris Oliver asked in General

I have one problem on install postgresql on create user.
here is command:
malin@XMAN:~$ sudo -u postgres createuser malin -s
output: sudo: unable to resolve host XMAN
output: sudo: setresuid() [1000, 106, 1000] -> [-1, 0, -1]: Operation not permitted
how can I fixed it? Thank you.

Reply

Hi,
can you do a tutorial to explain how it's possible to configure rubymine to edit a project? (project in ubuntu /home/User). I would like to use Rubymine i have install on windows to edit code in ubuntu subsysteme.

Thanks a lot!

Reply

did you get the answer for this?

Reply

Chris it would be interesting to update the tutorial for Windows 10 Creators Update considering the many new updates and improvements the Windows Subsystem for Linux has received! ;) https://blogs.msdn.microsof...

Reply

I will try doing that! I've gotta get my Windows 10 install back working again. :S

Reply
james chalmers james chalmers

My install works fine until 'gem install bundler' when I get this error:'/home/james/.rbenv/versions/2.4.0/bin/ruby: symbol lookup error: /home/james/.rbenv/versions/2.4.0/lib/ruby/2.4.0/x86_64-linux/socket.so: undefined symbol: parse_numeric_port'.
I'd appreciate any help as I really want to get WSL to work.

Reply

rvm works

Reply

Hello,

Thanks for the tutorial. It really helped me to get my basic setup up and running.
Thou I did have to fiddle around to get a few things working.
I should note that 5/14/17 I was not able to do

sudo -u postgres createuser YOURUSER -s

instead I had to use

sudo sudo -iu postgres createuser YOURUSER -s

due to -u not working at the time on WSL. Also I had to start the postgresql service before creating the user with

sudo service postgresql start

Hope this comments help people trying to install it later.

Thanks again for all your help and to all the RoR community, I just spent the last few days until I had my successful attempt at installing everything I wanted on WSL (yeah there were 4, I am now familiar with lxrun.exe /uninstall /full and lxrun.exe /install to reset the entire linux subsystem :P).

PS:
I would like to see added to the tutorial some information on installing MongoDB. For the moment I will just leave the link to the official tutorial https://docs.mongodb.com/ma... small comment though there are problems starting mongodb as a service so for now the only way I have found is to use sudo mongod. Also, remember to run mkdir /data/db before starting the database (that last bit is required but it is not included in the official tutorial from mongo).

Reply
JimboSliceOG JimboSliceOG

The source on my machine does not have the same path ~/.rvm/scripts/rvm

Mine is @: /usr/local/rvm/scripts/rvm

Also, The source is not persisting after exiting the terminal. And finally, it's failing when I try to start the rails server.

Reply

edit: got it working in the end, lots of patience required :)

Hello, thanks for the tutorial, however, I'm just trying to install rbenv and it has already taken 1 hour of waiting, it seems it is stuck on 'installing ruby-2.4.0...'. Should I just cancel and start afresh with rvm?

Reply

what did you do? I have same issue. Another comment mentioned he left it over night and was ready in the morning. It is crazy it takes this long. Cant imagine ruby being a huge program.

Reply
Francisco Javier Vallés Johnso Francisco Javier Vallés Johnso

I just want to share how I was able to install postgresql 9.5.
First, after running "sudo apt-get install postgresql-common postgresql libpq-dev" I got the error:

"http://archive.ubuntu.com/u... xenial-updates/main amd64 postgresql-client-9.5 amd64 9.5.7-0ubuntu0.16.04 Hash Sum mismatch"

So, as the console sugested, I executed it again adding "--fix-missing" and it worked.

Next, running "sudo sudo -u postgres createuser username -s" throwed the error:

"psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?"

which I solved by running "sudo pg_ctlcluster 9.5 main start".

Finally, trying to run "rails db:create" I got the error:

"new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)"

The solution for this was running:
- sudo sudo -u postgres psql
- UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
- DROP DATABASE template1;
- CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';
- UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
- \c template1
- VACUUM FREEZE;

I found all the above solutions searching in Google, but I don't remember the links.

Hope it helps someone and saves them some time.

Reply

I have mysql installed on windows. Do I need to install it separately on Linux Subsystem?

Reply

How old is this guide? I ask because, as of 6/22/2017 msdn quotes:
"Languages: Javascript/node.js, Ruby, Python, C/C++, C# & F#, Rust, Go, etc.
Services: sshd, MySQL, Apache, lighttpd,"

Suggesting that ruby should have full support now?

Reply

Thanks for the tutorial!

Just a note, it's "without further ado", not "without further adieu" 😉

Reply
francesco Esposito francesco Esposito

ruby-build: definition not found: 2.4.0 ??? help me plz

Reply
James Lucas Word James Lucas Word

I get this error anytime i start the rails server or type rails -v

rails-v
/home/word/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.1.3/lib/rails/app_loader.rb:40: warning: Insecure world writable dir /mnt/c in PATH, mode 040777
Rails 5.1.3

Reply

Great post. The install went fine, including the MySQL server installation, but when I try to connect to the MySQL server, I get the message: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I uninstalled it (sudo apt-get remove mysql-server) and re-installed. Same error message

If I try to re-install, I get the message that the MySQL server is already installed and is the latest version. Any ideas?

Reply

The install process, despite having asked me for the root password, etc., did not automatically start the MySQL server, so the solution is simple: sudo service mysql start

Reply

i got a q. now i am o root@laptop. does this mean i am on a vertual & so i can not get actual folders and files?

Reply
Yuri de Sales Almeida Yuri de Sales Almeida

Is it possible to share folders like vagrant?

Reply

I get following error. I followed everything as mentioned in the article.
Looks like mysql db is not created.
Missed any step?

praful@MOVO-PRAFULPASA:~/myapp$ rake db:create
#<mysql2::error: can't="" connect="" to="" local="" mysql="" server="" through="" socket="" '="" var="" run="" mysqld="" mysqld.sock'="" (2)="">
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>"******", "host"=>"localhost", "database"=>"myapp_development"}, {:charset=>"utf8"}
(If you set the charset manually, make sure you have a matching collation)
Created database 'myapp_development'
#<mysql2::error: can't="" connect="" to="" local="" mysql="" server="" through="" socket="" '="" var="" run="" mysqld="" mysqld.sock'="" (2)="">
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>"*****", "host"=>"localhost", "database"=>"myapp_test"}, {:charset=>"utf8"}
(If you set the charset manually, make sure you have a matching collation)
Created database 'myapp_test'
praful@MOVO-PRAFULPASA:~/myapp$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
praful@MOVO-PRAFULPASA:~/myapp$

Reply

Not sure if you ever got it working, and I don't have a solution really, but here are some thing's I would check.

Make sure the MySQL server is actually running. If so:

Get a visual MySQL Editor, there's alot of them, make sure your database encoding is UTF8, if it's not change it. The Visual Editor just makes it easier to check thing's out. It's a bit more simple than throwing commands into a console.

Check your Firewall, and make sure it's allowing connections on the MySQL servers port/s.

Make sure you have the correct permissions/privileges, both file system permissions, and privileges to access the MySQL service. For example MySQL may have been installed with only root, or admin access allowed. try opening the bash terminal as administrator, if that doesn't work try using sudo prefixed before commands (with, and then without admin privileges on the bash process.)

Sorry I couldn't give you a concrete solution, hope you get it working.

Reply

how to open Sublime, and point them to your folders in C:\code

Reply
Max Goncharov Max Goncharov

It's very sloooow. Did anybody get this issue with all Rails/Rake commands?

Reply

Good post.

I also needed to run the following, prior to installing ruby:
sudo apt-get install -y gcc libssl-dev libreadline-dev zlib1g-dev make

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,584+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.