I am trying to install Rails on OS X 10.7.5, using Homebrew and continue to receive the below Warning. I have tried many times to change the PATH to exclude the Python Directories (modifying .bash_profile, but am not even sure this is what is causing the Warning. Apologies if this is serious noob territory, but I could not find anything helpful after hours of searching. Homebrew warning:
Warning: "config" scripts exist outside your system or Homebrew directories.
./configure scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/Library/Frameworks/Python.framework/Versions/Current/bin/python-config
/Library/Frameworks/Python.framework/Versions/Current/bin/python2.5-config
/opt/sm/pkg/active/bin/curl-config
/opt/sm/pkg/active/bin/ncurses5-config
/opt/sm/pkg/active/bin/ncursesw5-config
/opt/sm/pkg/active/bin/pkg-config
/opt/sm/pkg/active/bin/xml2-config
/opt/sm/pkg/active/bin/xslt-config
I think you should make installation of Rails using gem tool . Rails is just a gem and in should not be installed by homebrew . First install the newest version of Ruby , then google a little about gem management system and give it a go . Here is a nice Railscast on the subject.
Related
So I've been searching everywhere and I'm completely stuck right now. Initially I just installed the binaries which came with luarocks.exe and luarocks_admin.exe but with that there was no config file so when I go to install the luarocks-mysql module, luarocks was unable to find the lua library and said I needed to set the LUA_LIBDIR variable in the config. I can't make changes to the luarocks config though because it either doesn't exist or I can't find it.
After getting this problem I went back to install the luarocks all in one package but I'm unable to follow the instructions because I can't find the install.bat file that they were talking about. Sorry if this is a lot but I'm just running into a bunch of problems right now.
EDIT: Just use Ubuntu, it's 100 times easier.
I had similar problems. I didn't look for a solution and just installed wsl on windows 10.
https://learn.microsoft.com/en-us/windows/wsl/install
Then execute the commands in the console:
sudo apt install lua5.3 liblua5.3-0 liblua5.3-dev
sudo apt install luarocks
on luarocks install lyaml I get following error:
Error: Could not find expected file libyaml.a, or libyaml.so, or libyaml.so.* for YAML -- you may have to install YAML in your system and/or pass YAML_DIR or YAML_LIBDIR to the luarocks command. Example: luarocks install lyaml YAML_DIR=/usr/local
lua version: 5.1.5
How do I install YAML in system to start using lyaml rock?
Whenever you get a LuaRocks message saying you may have to install ____ in your system it means the rockspec has an external dependency.
Installing external dependencies
The way to satisfy this dependency is to install the package using the appropriate means of your system: if using Debian/Ubuntu, with apt-get, if using macOS, probably using Homebrew, etc.
Note that for building code, in systems that have the concept of dev packages, such as most Linux distributions, you need to install both the main library package and the dev package (which contains the header files for compilation). For example, for Debian/Ubuntu, to satisfy this dependency you need to run apt-get install libyaml libyaml-dev.
Unfortunately, the names are not fully consistent across systems and distros: a module may be called ncurses-dev in one system, libncurses6w-dev in another, etc. So in your particular case you'll have to search around for the right name of the YAML library (the package providing libyaml) in your system.
Once the external dependency is installed...
Installing a library with the system package manager will usually install the necessary files in locations that are automatically detected by LuaRocks, so running
luarocks install lyaml
again should find the libyaml files and proceed with the installation.
If external dependencies are installed in a non-standard location
If that fails, you can find the directories where the library (libyaml.so) and header (yaml.h) were installed and tell LuaRocks about it. For example, if libyaml.so was installed in some non-standard locations such as /opt/lib/yaml/libyaml.so and the header in /opt/include/yaml-1/yaml.h you would do this:
luarocks install lyaml YAML_LIBDIR=/opt/lib/yaml/ YAML_INCDIR=/opt/include/yaml-1/
This kind of situation happens when a system installs headers or libraries in a subdirectory. For example, for LuaSec on the Mac, which uses OpenSSL, it is sometimes necessary to use pathnames like this:
luarocks install luasec OPENSSL_INCDIR=/usr/local/opt/openssl/include OPENSSL_LIBDIR=/usr/local/opt/openssl/lib
I am a complete newb to lua, but so far I like it.
I want to install love because it provides a nice framework and want to explore its features. I can already run lua scripts (luarocks comes with lua5.1.) and I have the zerobrain IDE. I installed socket.rock by getting the .rock file and running:
luarocks install luasocket-2.0.2-3.win32-x86.rock
But I can't find a similar file for love. I found this website: luarocks-love, which tells me:
luarocks install --server=http://luarocks.org/m/love <name>
So I can run this, but I don't know what <name> means... I tried it without <name> and I get an error. Can someone explain what I am missing here?
Thanks!
You can't install Love via luarocks. Love isn't a library.
The installers for Windows are available here.
What you have there is just used for installing libraries using luarocks that depend upon Love. It is not the framework itself.
I'm trying to use luagraph, a binding to the graphviz library:
http://luagraph.luaforge.net/index.html
To install, I'm using luarocks in Mac OS X. The following command is executed in bash:
luarocks install luagraph
The output is the following:
Installing https://luarocks.org/luagraph-1.0.4-1.src.rock... Using
https://luarocks.org/luagraph-1.0.4-1.src.rock... switching to 'build'
mode
Error: Could not find expected file graphviz/graph.h, or
graphviz/graph.h for GRAPHVIZ -- you may have to install GRAPHVIZ in
your system and/or pass GRAPHVIZ_DIR or GRAPHVIZ_INCDIR to the
luarocks command. Example: luarocks install luagraph
GRAPHVIZ_DIR=/usr/local
I have been installed graphviz using homebrew, but I can't figure out how to pass GRAPHVIZ_DIR or GRAPHVIZ_INCDIR properly.
How can I install luagraph?
I've updated LuaGRAPH a couple of weeks ago. It now supports the newest version of Graphviz based on the cgraph library instead of the old graph library.
There is one drawback: I couldn't get luagraph to run on Windows using mingw because of some runtime library issues (compiler and dll compatibility probably). Please look at the README file for more details.
I personally never produced a rockspec for this module. This was created by someone else based on a fork of my luagraph library.
Installation without Luarocks is simple. Download from
https://github.com/hleuwer/luagraph
and follow the instruction in the documentation and the README file. You need adopt a simple config file which is included by make.
Herbert
Well, luaGRAPH is still the top result when searching for lua and graph. So the question is still standing.
And, unfortunately, the answer is: luagraph is OLD, the last update happened before the ubuntu 14.04 was released. And there seem to be some notable changes in the system itself, the flags the error message show do not seem to work. On top of that, graphviz is now about 20 releases newer than the luarock recommends.
There now is a bare bone alternative lua package: graphviz
It is extremely basic, and documentation in not at all informative, but at least it works.
update: Luagraph may be working again, but not through rocks. See the other answer.
I am writing a small Lua project and using Luarocks to install my 3rd-party dependencies. The default Lua version on my machine is 5.2 and up to this point everything is working just fine.
However, today I have stumbled across a problem that is confusing me. I want to run my program on Lua 5.1 and Luajit to see if it would also work on those versions but I am having a hard time getting Luarocks to download the appropriate versions of the dependencies. As a last resort hack, I have tried to tell Lua5.1 to use the 5.2 libraries that Luarocks installed (by setting the LUA_PATH environment variable to the same value as LUA_PATH_5_2) but unfortunately that is not enough: my project depends on LuaFileSystem, a C-based module, so I'm going to need to have separate versions of it installed for 5.1 and 5.2.
What do I have to do to install both the 5.1 and 5.2 versions of my dependencies? Do I need to pass some parameters to theluarocks install command? Do I need to have multiple instances of Luarocks installed on my machine? One thing that confuses me is that the inside the .luarocks folder things are classified under a 5.2 subfolder (~/.luarocks/share/lua/5.2/), suggesting that maybe there could be a way to install things in a sibling 5.1 folder but at the same time there is only one bin folder, suggesting that luarocks is only able to handle one version of Lua at a time...
Based on your reference to ~/.luarocks/share/lua/5.2/, you seem to be running a Unix system (Linux or Mac). You can install the latest version of LuaRocks twice, for both Lua 5.1 and Lua 5.2 like this:
./configure --lua-version=5.1 --versioned-rocks-dir
make build
sudo make install
And then again for 5.2:
./configure --lua-version=5.2 --versioned-rocks-dir
make build
sudo make install
This will get you /usr/local/bin/luarocks-5.1 and /usr/local/bin/luarocks-5.2. If you installed Lua 5.1 and 5.2 in /usr/local/, and each of them will use its own ~/.luarocks/lib/luarocks/rocks-5.x/ entry for the user tree (and /usr/local/lib/luarocks/rocks-5.x for the system tree), and install modules to the right location at /usr/share/lua/5.x/ and ~/.luarocks/share/lua/5.x/ (and likewise for lib) appropriately.
As suggested by moteus, I decided to install a second version of Luarocks for Lua 5.1. But he is using Windows and I am using Linux so here is what I did:
Download the source for the latest version of Luarocks on the Luarocks website
From the source directory, run the ./configure script:
/configure --prefix="${HOME}/.luarocks51" --lua-suffix=5.1
The prefix setting tells Luarocks to put its stuff on the .luarocks51 folder, next to the existing .luarocks folder from my 5.2 install of Luarocks. The lua-suffix parameter tells Luarocks to use Lua 5.1 instead of the default lua version in my machine (5.2). This depends on me having named the interpreter for Lua 5.1 as lua5.1 (Debian installed mine on /usr/bin/lua5.1). Finally, Luarocks managed to automatically detect where the 5.1 headers and libraries are installed (/usr/include/lua5.1/) but if it didn't I guess I could have specified that with the --with-lua-include and --with-lua-lib parameters.
Compile Luarocks with make
Install it with make isntall (no need for Sudo since I'm installing it in a local directory).
Configure my 5.1 environment to use the libraries downloaded by Luarocks. I added the following to my .bashrc:
export PATH=$PATH:~/.luarocks/bin:~/.luarocks51/bin
export LUA_CPATH=";;${HOME}/.luarocks51/lib/lua/5.1/?.so"
export LUA_PATH=";;${HOME}/.luarocks51/share/lua/5.1/?.lua;${HOME}/.luarocks51/share/lua/5.1/?/init.lua"
export LUA_CPATH_5_2=";;${HOME}/.luarocks/lib/lua/5.2/?.so"
export LUA_PATH_5_2=";;${HOME}/.luarocks/share/lua/5.2/?.lua;${HOME}/.luarocks/share/lua/5.2/?/init.lua"
The 5.1 configuration also works for Luajit.
The executable for the 5.1 version of luarocks is named luarocks-5.1:
luarocks-5.1 install lfs
You have to mention both lua version and lua dir in the latest versions:
luarocks --lua-dir=$(brew --prefix)/opt/lua#5.1 --lua-version=5.1 install lua-cassandra
Using homebrew, you can do:
brew install lua51 # Lua 5.1
brew install lua # Lua latest
Luarocks comes with Lua, so you can do:
# Install Lua 5.1 version of any package
luarocks-5.1 install moonscript
# Install Lua latest version of any package
luarocks install moonscript