- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
首先,抱歉我的英语不好。
我正在尝试通过适用于 Linux 的 Windows 子系统(即 Windows 10 上的 Ubuntu)使用 rbenv 在我的系统上安装 Ruby 2.3.0。我遵循了 this。说明(但不完全是 100%)。但每次我尝试时,它都无法使用此日志构建 Ruby。
check struct members..
check libraries....
Use ActiveTcl libraries (if available).
Search tclConfig.sh and tkConfig.sh..............................
Fail to find [tclConfig.sh, tkConfig.sh]
Use X11 libraries (or use TK_XINCLUDES/TK_XLIBSW information on tkConfig.sh).
Warning:: cannot find X11 library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options. If your Tcl/Tk don't require X11, please try --without-X11.
Can't find X11 libraries.
So, can't make tcltklib.so which is required by Ruby/Tk.
Failed to configure tk. It will not be installed.
Failed to configure tk/tkutil. It will not be installed.
configuring zlib
make[1]: Entering directory `/tmp/ruby-build.20160522033606.7696/ruby-2.3.1'
make -C ext/digest/sha2 -w --jobserver-fds=6,7 -j V= realclean
make[2]: Entering directory `/tmp/ruby-build.20160522033606.7696/ruby-2.3.1/ext/digest/sha2'
Makefile:39: *** missing separator. Stop.
make[2]: Leaving directory `/tmp/ruby-build.20160522033606.7696/ruby-2.3.1/ext/digest/sha2'
make[1]: *** [ext/digest/sha2/realclean] Error 2
make[1]: Leaving directory `/tmp/ruby-build.20160522033606.7696/ruby-2.3.1'
make: *** [build-ext] Error 2
这是我安装的包列表
libx11-data/trusty,now 2:1.6.2-1ubuntu2 all [installed]
libx11-dev/trusty,now 2:1.6.2-1ubuntu2 amd64 [installed]
libx11-doc/trusty,now 2:1.6.2-1ubuntu2 all [installed,automatic]
libx11-xcb1/trusty,now 2:1.6.2-1ubuntu2 amd64 [installed,automatic]
libtk8.4/trusty,now 8.4.20-7 amd64 [installed,automatic]
libtcl8.4/trusty,now 8.4.20-7 amd64 [installed,automatic]
如您所见,我安装了 X11、tcl、tk,但我的系统无法检测到它们。我做错了吗?或者这只是一个错误?
如有任何帮助,我们将不胜感激。感谢您的阅读。
最佳答案
我的安装遵循本教程,去那里获取最新更新:link here .
首先是 Ruby 的一些依赖:
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev
现在对于Ruby:有3种安装方式,每种方式相互冲突,所以选择一个你认为最适合你的或者我的建议:rbenv
使用 rbenv(推荐)
cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v
使用rvm
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.3.1
rvm use 2.3.1 --default
ruby -v
来自源头
cd
wget http://ftp.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz
tar -xzvf ruby-2.3.1.tar.gz
cd ruby-2.3.1/
./configure
make
sudo make install
ruby -v
安装Ruby后,安装Bundler
gem install bundler
首先你需要 NodeJS:
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
然后安装导轨:
gem install rails -v 4.2.6
如果您使用的是 rbenv
,则需要运行以下命令以使 rails 可执行文件可用:
rbenv rehash
现在您已经安装了 Rails,您可以运行 rails -v 命令以确保您已正确安装所有内容:
rails -v
# Rails 4.2.6
MySQL:
您可以从 Ubuntu 存储库中的软件包安装 MySQL 服务器和客户端。作为安装过程的一部分,您将为 root 用户设置密码。此信息将来会进入您的 Rails 应用程序的 database.yml 文件。
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
PostgreSQL:
目前,一些错误阻止您正确安装 Postgres,所以我现在推荐您使用 MySQL。
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common
sudo apt-get install postgresql-9.5 libpq-dev
Postgres 安装不会为您设置用户,因此您需要按照以下步骤创建具有创建数据库权限的用户。请随意用您的用户名替换 chris。
sudo -u postgres createuser chris -s
# If you would like to set a password for the user, you can do the following
sudo -u postgres psql
postgres=# \password chris
现在确保事情向右而不是向左
#### If you want to use SQLite (not recommended)
rails new myapp
#### If you want to use MySQL
rails new myapp -d mysql
#### If you want to use Postgres
# Note that this will expect a postgres user with the same username
# as your app, you may need to edit config/database.yml to match the
# user you created earlier
rails new myapp -d postgresql
# Move into the application directory
cd myapp
# If you setup MySQL or Postgres with a username/password, modify the
# config/database.yml file to contain the username/password that you specified
# Create the database
rake db:create
rails server
关于ruby - 在 WSL(适用于 Linux 的 Windows 子系统)上安装 Ruby 2.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37405528/
你怎么能管理这样的事情?我尽我最大的努力将子系统设计为可重用,但只有某些特定于站点的东西必须自定义(例如 Account 实体中的字段,或 orm 注释中的 cfc="")。 我曾想过使用 SVN 并
我正在编写 native 模式应用程序(想想: link /subsystem:native )。这意味着我不能使用 kernel32.dll 中的任何内容,这(显然)在 C 运行时库中没有任何意义。
我注意到使用 emscripten,即使是相对较小的 C++ 文件也可以快速转换为相当大的 JavaScript 文件。示例: #include int main(int argc, char**
在恢复模式下运行标准 Windows 7 安装盘时,如果您打开命令行并运行自定义构建的应用程序,您将收到错误“不支持子系统”。我试过与/SUBSYSTEM:CONSOLE、WINDOWS 和 NATI
我有一个生成一些报告并在 GUI 中显示相同内容的 MFC 应用程序。当使用某些命令行参数传递时,我需要将它作为控制台应用程序运行。在控制台模式下,它将在标准输出/错误中生成报告/错误,我应该能够将其
本文讲解 pinctrl 子系统和 gpio 子系统的 API,以及使用示例。 传统的配置 pin 的方式就是直接操作相应的寄存器,但是这种配置方式比较繁琐、而且容易出问题(比如 pin 功能
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 8 年前。
Windows Vista Enterprise 和 Ultimate 的要点功能之一是 Windows 的 Unix 子系统,它允许您编写 posix... 东西?不管怎样,我不喜欢谈论它……有人使
我在 Windows 10 上的 WSL 中使用 Ubuntu,并且我在 WSL 中安装了 git 并定期使用它。我有一个非常烦人的问题,我尝试缓存我的 github 凭据,因此我不必在提交时不断输入
我正在使用旧的 bcc32 (borland 5.5)(我知道这很旧编译器但不要告诉我我不应该使用它) 我可以使用控制台或 Windows 子系统进行编译。 我不想用 windows 子系统编译,我想
设置: 榛子:3.12.3 Spring 启动:2.1.6 Java:1.8 参数:-XX:+UseG1GC Xms7g -Xmx7g 这些正在 Docker 中运行:openjdk:8 它们在专用
我曾经在 Windows 10 的 Linux 子系统上通过 bash 控制台通过 ssh 连接到我的服务器。 我重新安装了 Windows,并将 id_rsa、id_rsa.pub 和 known_
我目前在我的 C 代码中使用 inotify() 系统来监视文件系统中某些目录的事件。 现在,使用这些东西之一的过程如下。你取一个整数(比如 event_notifier),使用 inotify_in
安装 WSL 1. 开启WSL 必须启用“适用于 Linux 的 Windows 子系统”可选功能并重启,然后才能在 Windows 上运行 Linux 发行版。 以管理员运行Powershell(开
我正在学习如何使用 https://intermezzos.github.io 构建基本的操作系统内核 我已经创建了我的 .iso文件,我正在运行 qemu-system-x86_64 -cdrom
不久前我使用 crontab -e 设置了一些 cronjobs .我的 crontab 包括以下行: * * * * * /usr/bin/touch /home/blah/MADEBYCRON 我
我已经安装了 visual studio 2008 Professional Edition,但我无法在其中一个 visual C++ 项目中设置/SUBSYSTEM:POSIX 选项。我还从 SUA
基本上,我需要一个程序来将 Windows .exe 从控制台对应项中排序。 文件扫描器: SortExe(file exe) { if (IsPeWindows(exe)) {
我有一个 python 脚本,我想在计算机的剪贴板中放置一个字符串。我在 Linux、Mac 和以前使用 cygwin 在 Windows 中工作。我不得不修改一行代码以使其在各自的系统中工作。我无法
最近发布了 Windows 10 周年更新的新更新,包括 Linux 子系统 based on Ubuntu 14.04而现在我希望我所有的工作环境都在这个 Linux 子系统中。 我尝试按照官方网站
我是一名优秀的程序员,十分优秀!