This is the starting point for getting help on any issue relating to working with the dev.to open source project. This thread will act as an FAQ destination of sorts. Do not feel shy posting here, we'll continuously keep an eye on this thread and we urge anyone to hop in to help in any way they can.
We will occasionally start new threads with an updated version number to keep up with the state of the project as things change over time and information in here become out of date.
We plan to eventually use DEV Connect channels as sort of breakout rooms for different parts of the project, but not as one massive room. The specifics of how weโll leverage Connect rooms is a bit to be determined.
I urge folks involved in the project to hit the save button (๐) to track discussion in these threads in your reading list comment activity area.
Happy coding โค๏ธ
Top comments (109)
I have similar issue running
bundle install
only have Ruby 2.5.1 installed.
I have tried restarting terminal and machine both just to clear cache if there's any.
Did you set 2.5.1 as the global version?
According to karloespiritu.github.io/cheatsheet... you need to type:
rbenv global 2.5.1
, otherwise it uses the default version shipped with the OSThanks for the cheatsheet. Yes, I have tried rbenv global 2.5.1.
When you are in the directory of the project, what does
rbenv version
say?I feel like something is messed up with the
/etc/paths/
although can't seem to figure it out. I am following this link here-: stackoverflow.com/questions/873067...What's the output of
ruby -v
compared torbenv version
?Try running
rbenv shell 2.5.1
and then runningbundle
.If not, a reinstall of
2.5.1
might help:Let me know how it goes!
Thanks Andy. I did a reinstall of rbenv and ran below.
โฏ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin15]
โฏ rbenv version
2.5.1 (set by RBENV_VERSION environment variable)
โฏ rbenv shell 2.5.1
still see the same issue.
โฏ bundle install
Your Ruby version is 2.0.0, but your Gemfile specified 2.5.1
Ah, your
bundle install
might be running from your old Ruby version as opposed to the latest one.Try running
which gem
andwhich bundle
. You should be seeing something similar to this output:If it's different, you'll probably see that
bundle
orgem
are running from different paths thanruby
.That did it. Thanks for the tip.
gem and ruby paths were same but bundle. I updated the PATH for bundle gem file using BUNDLE_GEMFILE
Awesome! Glad to know it worked. From my experience, it's "cleaner" to reinstall your gems per version, but I'm not too sure if it matters too much.
Hey, I am currently working on some night mode bugs and my work mainly works on editing scss/css files,
nevertheless I want to run a local setup of the application in an attempt to check the changes I am making.
I am having the same error as above only that dev.to required ruby version
2.6.1
but it seems to be picking up2.3.7
from my system macOSI have followed all the steps but to no use, I have little to no experience in ruby. could use your help in the same.
I don't have a ton of ruby experience so I actually ran into what I thought was a problem installing ruby with
rbenv
. I just wanted to share my experience here in case others run into the same issue.I started by installing
rbenv
with homebrew.No issues, cool. Then I went to install the current ruby version of 2.6.1 in rbenv but it kept hanging on the following line.
I kept canceling out of it thinking it was stuck but it was actually building in the background. The installer could use some work giving users some sort of visual feedback that it's actually building. I looked it up and stumbled on to a GitHub issue about it: github.com/rbenv/ruby-build/issues...
One of the comments mentioned that you can actually use the
install -v
flag when installing with rbenv to get a verbose output of the build process in your terminal. I then ran the following:And no more hanging on readline! It will fill your terminal window with build logs but at least you know it's working.
Hope this helps someone!
Great tip, thanks!
Here's something I ran into as I'm going through the setup instructions, in case anyone else has the same problem.
When I did
gem install bundler
, I got this error message:It might have occurred because I uninstalled rvm (using rvm implode ) after installing rbenv.
The fix (found here ) was to add
eval "$(rbenv init -)"
to my .bash_profile (then dosource ~/.bash_profile
). After thatgem install bundler
worked.Awesome, thanks for sharing!
I found the solution in this site
usabilityetc.com/articles/ruby-on-...
I can't explain how helpful this is. You saved me from a great amount of trouble. Thank you!
Hey Tristan, definitely not a stupid question :)
It's probably a bit early to realistically stand up a fully self-hosted instance of DEV.
If your company is sharing technical content that is for public consumption, you're welcome to set up an organization account on the production site. You can look at Heroku as an example. You never know what might help other users.
@ben will follow up with a bit more info and context.
Yeah, org accounts are the recommended way to go right now, but the instance direction is something we could start working on right away, as long as weโre willing to be patient along the way.
So that area has to be thought of as really theoretical at this point, but being an early adopter of that path could be very powerful, so you are welcome to volunteer to become part of our early group who might start thinking about that use case. Let me know if youโd like me to keep you in the loop.
Does anyone know how to update the built-in version of ruby on Mac?
I ended up getting around it by using RubyMine and telling it to use the brew version for the dev.to environment, and then I set up the bin scripts as run configurations.
Since I had ruby 2.5.1 installed, I wasn't terribly inclined to download RVM just so it could download its own version of ruby, too. I just don't think this was the most optimal way of fixing my version issues.
(And as someone who never used postgressql before, that part was not intuative at all... but I have no clue how to fix that in the docs, since I was bumbling my way through it)
I use RVM because I have different projects using different versions of Ruby and it's useful for that:
Can you please articulate what issues did you have? I think it's very important because a difficult onboarding can be a turn off for first contributors. Thank you!
My issue was trying to figure out how to articulate it late at night ;)
I think the issues started with completely blowing past the hey you need to install this stuff first section of the README and just starting to get the local build working with stuff like api keys and bundle install. And since I was having issues with the ruby version, I was inclined to think all my issues were around ruby rather than the db.
The biggest thing after needing it installed was needing to have it run before running anything. The installation was lumped with installing things like bundle and yarn which are more hands-off, so it wasn't clear that after installing the prereqs, I should actually start the db and that it wasn't handled in the bin scripts like everything else.
Then I wanted to actually see what was in the db, so I hunted through the configs and internet to see how to find the settings of the db that's created to connect to it within RubyMine.
It wasn't anything really hard or missing, just stuff that wasn't obvious as someone not in the stack.
Ah gotcha, we'll shore that up for the next iteration. What sort of issues are you having right now with it?
Are you using a Ruby version manager? You probably have
rbenv
orrvm
installed.As far as I know, I have not because I'm not a Rubyish person, but I can check once I get home. I knew I brew installed it and would have installed it way back when for brew (since I'm pretty sure brew runs on ruby) but otherwise I don't recall ever doing anything with ruby.
Right now, nothing, since I was eventually able to get local dev.to up and running to get my screenshots for my PR :) Originally, though, since I was only installing it to use dev.to, I didn't:
Like, reading the section of hey install this stuff didn't really click with me to actually run the database and that it was not a part of the bin scripts.
Ah gotcha, sorry that wasn't clear! We'll definitely update the instructions for the prerequisites.
And yep, let me know if you still have issues with your Ruby, or anything else really. ๐
I'm getting the following error when running
bin/setup
:But I already added the Algolia keys to
config/application.yml
:It seems like the ENV variables aren't being set, despite changing
application.yml
. I'm not sure what I'm missing.Hm that's strange. Try these two things:
config/application.yml
and notsample_application.yml
.spring
error, which is a Rails app preloader. If spring is running, it'll runbin
commands for you, but sometimes doesn't refresh when you change things like environment variables. Try turning it off withspring stop
and then runningbin/setup
again.Spring wasn't actually running, but I figured out what the issue was.
When I ran
git status
, it seemed like I accidentally made some changes toconfig/application.rb
. I undid those changes and nowbin/setup
works.Thanks for trying to help though!
Great! Glad it's resolved :)
Hello everyone!
I'm trying to write specs for login/signup procedure.
I've inspected the code and came out with these potential scenarios.
Can someone help me to correct, validate, refine these scenarios to met the reality?
(I follow the format ---> )
1 User never login before
create new user
create new identity
update user data
create session
go to welcome page
2 User second login with same provider
find existing user
find existing identity
update user data
create session
go to dashboard
3 User second login with other provider
find existing user
create new identity
update user data
create session
go to dashboard
4 User revoked authorization on twitter, login and re-authorizes
find existing user
find existing identity
update user data
create session
go to dashboard
Error cases โโ
5 Twitter doesnโt provide enough information for the user (letโs say uid is nil)
don't create session
go to back to same page
display error message
Twitter authorization problem. Try again later
Yep, that sounds right. We have a feature test for Twitter auth
/spec/features/user_logs_in_with_twitter_spec.rb
and some other tests for registration inspec/models/user_spec.rb#270
. Those should be helpful for see what else would need coverage.Awesome thanks I'll take a look.
@ben ^ ?
That seems like the right path. @andy can provide more thoughts
Hello! I was successfully able to run
bin/setup
andbin/startup
does work and spin up the server, but when I go to the localhost port it tells me, I get aCannot GET /
error. All routes seem to be doing this. Anyone had this problem before? Do I need to input any keys above and beyond the Algolia ones to get the base site to work?Hmm, not sure what that's about. Do you have another server that's connected to
localhost:3000
? Although if you do, you wouldn't have been able to start up the server.Could you drop a screenshot of the browser on
localhost:3000
and maybe a snippet of the server logs?OH I think I know what it is. You might have went to
localhost:3035
which is running Webpack. It might not be exactly 3035, but it's something similar and is notlocalhost:3000
.localhost:3000
is the port for the backend Rails server, which is the one you want to visit.Also, now that I've got it set up, props to whoever on your team likes this book:
oh wait, there we go! I think I did have something else running on 3000โnot surprising, since I am always running like five development servers, but I should have double-checked that port was open. Thanks!
When running
bin/setup
I get the following error:Not sure what to do from here.
Hey Jibran, looks like you have some error with Algolia. You'll need Algolia API keys in order to run the local server on your machine. See our guide here on how to get it: docs.dev.to/get-api-keys-dev-env/
Hey Andy,
Got it to work. Silly setup error on my part. Thanks!
Gotcha :) Glad it's working!
Hello,
Trying to setup locally on my machine but running into an error after running
bin/setup
Has anyone else come across this before as finding it tricky to debug?
The console also throws this error at end of log
So seems like db issues.. is there anything specific I need to do to set this up? I've just been following the installation steps where it only mentions to have postgresql 9.4 or higher (which I have)
Thanks for any help in advance!
Oh that's a strange error. I can't seem to reproduce it, but I think it might be something with the
profile_image_url
we're using. It's currently randomly generated by a gem, but feel free to replace it with any other valid image. The only non-standard validation we have for images is that its dimensions have to be less than or equal to 4096x4096.You can replace line #31 in the
seeds.rb
file with any URL you'd like:Faker::Fillmurray docs here, if you're so inclined. ๐
Thank you!
Yes that was it, I've now been able to get running using my own profile pic. As happy as I am that it's working now am quite sad I've not been able to use the Bill Murray Faker... ๐
For info I was getting a 'redirect' error
...which seemed like it was expecting
https
in the url, but I couldn't find an easy way to resolve this.But all good with a non-Faker url for the profile image ๐
Awesome, glad it worked! Unfortunate about Bill Murray ๐
Some comments may only be visible to logged-in visitors. Sign in to view all comments.